Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool gameover;
- const int width = 20;
- const int heigth = 20;
- int x, y, fruitX, fruitY, score;
- enum eDirection {STOP = 0, LEFT, RIGHT, UP, DOWN};
- eDirection dir;
- void setup()
- {
- gameover = false;
- dir = STOP;
- x = width / 2;
- y = heigth / 2;
- fruitX = rand() % width;
- fruitY = rand() % heigth;
- score = 0;
- }
- void draw()
- {
- system("cls");
- for(int i = 0; i < width + 1; i++)
- cout << "#";
- cout << endl;
- for (int i = 0; i < width; i++)
- {
- for (int j = 0; j < heigth; j++)
- {
- if (j == 0 || j == heigth - 1)
- cout << "#";
- cout << " ";
- }
- cout << endl;
- }
- for(int i = 0; i < width + 1; i++)
- cout << "#";
- }
- void input()
- {
- }
- void logic()
- {
- }
- int main()
- {
- setup();
- while (!gameover)
- {
- draw();
- input();
- logic();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement