Commit c07c718e authored by Justin Mueller's avatar Justin Mueller

add placeholders

parent 095ceb63
......@@ -5,13 +5,16 @@ using namespace std;
const int line = 5;
const int columns = 8;
void fillSpace(string board[line][columns]);
int main() {
string board[line][columns];
for (int i = 0; i < line*2+1; ++i) {
fillSpace(board);
for (int i = 0; i < line * 2 + 1; ++i) {
if (i == 0) {
// First row, first column
cout << "╔";
for (int k = 0; k < columns-1; k++) {
for (int k = 0; k < columns - 1; k++) {
cout << "═══";
cout << "╦";
}
......@@ -20,43 +23,59 @@ int main() {
} else if (i == line * 2) {
// LAST row, LAST column
cout << "╚";
for (int k = 0; k < columns-1; k++) {
for (int k = 0; k < columns - 1; k++) {
cout << "═══";
cout << "╩";
}
cout << "═══";
cout << "╝\n";
} else if (i % 2 != 0) {
} else if (i % 2 == 0) {
cout << "╠";
for (int k = 0; k < columns - 1; k++) {
cout << "═══";
cout << "╬";
}
cout << "═══";
cout << "╣\n";
} else {
cout << "║";
for (int j = 0; j < columns; j++) {
cout << "║";
switch (i) {
case 1:
cout << board[i][j];
cout << board[i-1][j];
break;
case 3:
cout << board[i-1][j];
cout << board[i - 2][j];
break;
case 5:
cout << board[i-2][j];
cout << board[i - 3][j];
break;
case 7:
cout << board[i-3][j];
cout << board[i - 4][j];
break;
case 9:
cout << board[i - 5][j];
break;
}
cout << "║";
}
cout << "\n";
} else {
cout << "╠";
for (int k = 0; k < columns-1; k++) {
cout << "═══";
cout << "╬";
}
cout << "═══";
cout << "╣\n";
}
}
return 0;
}
void fillSpace(string board[line][columns]) {
for (int i = 0; i < line; i++) {
for (int j = 0; j < columns; j++) {
board[i][j] = " ";
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment