diff --git a/snake.cpp b/snake.cpp index 284e720..a9845c7 100644 --- a/snake.cpp +++ b/snake.cpp @@ -7,7 +7,7 @@ using namespace std; bool gameOver; const int width = 40; -const int height = 20; +const int height = 40; int x, y, fruitX, fruitY, score; int tailX[100], tailY[100]; int ntail; @@ -28,29 +28,31 @@ void setup() { void draw() { SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), {0,0}); - for(int i = 0; i < width + 2; i++) cout << "#"; - cout << "\n"; + cout << "┌"; + for(int i = 1; i < width + 1; i++) cout << "─"; + cout << "┐\n"; for(int i = 0; i < height; i++) { for(int j = 0; j < width; j++ ) { - if(j == 0) cout << "#"; + if(j == 0) cout << "│"; if(i == y && j == x) cout << "O"; else if(i == fruitY && j == fruitX) cout << "F"; else { bool print = false; for (int k = 0; k < ntail; k++) { if (tailX[k] == j && tailY[k] == i) { - cout << "o"; + cout << "@"; print = true; } } if(!print) cout << " "; } - if(j == width - 1) cout << "#"; + if(j == width - 1) cout << "│"; } cout << "\n"; } - for(int i = 0; i < width + 2; i++) cout << "#"; - cout << "\n"; + cout << "└"; + for(int i = 1; i < width + 1; i++) cout << "─"; + cout << "┘\n"; cout << "score:" << score << "\n"; cout << "Time: " << timer << "s\n"; // Display timer