-
Notifications
You must be signed in to change notification settings - Fork 0
/
Desk.cpp
52 lines (44 loc) · 956 Bytes
/
Desk.cpp
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
#include"snake.h"
char SELECT() {
char result = _getch();
cleardevice();
return result;
}
void DEBUGAlpha(bool op) {
int i = 0;
double agedebuggingResults = 0;
while (i++ < 100) {
InitMsp();
while (CheakSnakeSafety()) {
MoveSnake();
TrunSnake(true, op);
}
agedebuggingResults += debuggingResults();
printf("\n\tNo.%-4d %%%3.1lf", i, 100 * debuggingResults());
if (i % 5 == 0) {
//print();
printf("\n\n\tAge: %%%4.2lf", agedebuggingResults / i * 100);
if (op) {
fnDisplaySnake(1);
Sleep(500);
if (_kbhit())
system("pause");
}
}
}
printf("\n\n\n\n\tAge: %%%4.2lf", agedebuggingResults / (i - 1) * 100);
system("pause");
}
void GameStart(bool isHuman_AI) {
InitMsp();
while (CheakSnakeSafety())
{
MoveSnake();
fnDisplaySnake(isHuman_AI);
TrunSnake(isHuman_AI, 1);
}
fnDisplaySnake(isHuman_AI);
system("pause");
}
void HELP() {
}