-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
55 lines (48 loc) · 2.04 KB
/
main.c
File metadata and controls
55 lines (48 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int score = 125;
int food[2];
int main()
{
food[0] = 16;
food[1] = 13;
DrawGame(score);
gotoxy(food[0], food[1]);
printf("O");
gotoxy(0,23);
return 0;
}
void DrawGame(int score)
{
printf("######################################################\n");
printf("# SNAKE by Adam Zegadlo SCORE: %3d #\n", score);
printf("######################################################\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("# #\n");
printf("######################################################\n");
}
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}