-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualization.cpp
More file actions
55 lines (47 loc) · 1.3 KB
/
Copy pathvisualization.cpp
File metadata and controls
55 lines (47 loc) · 1.3 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
#include <iostream>
#include "conio.h"
#include "functions_definitions.h"
void vis_cases(int& zn, int& index, int& number_of_states, bool& print_database,
Board* table_of_boards, Player* table_of_player_1, Player* table_of_player_2)
{
do
{
zn = getch();
switch (zn)
{
case 'N':
if (index < number_of_states - 1) { index++; }
print_visualization_interface(table_of_boards, table_of_player_1, table_of_player_2, index);
break;
case 'P':
if (index > 0) { index--; }
print_visualization_interface(table_of_boards, table_of_player_1, table_of_player_2, index);
break;
case 'D':
print_database = true;
break;
case 'Q':
break;
default:
gotoxy(1, 1);
std::cout << "Wrong symbol";
zn = 'Q';
break;
}
} while (zn != 'Q' && print_database == false);
}
void visualization(Board* table_of_boards, Player* table_of_player_1, Player* table_of_player_2, int number_of_states)
{
int index = 0;
int zn = 0;
print_visualization_interface(table_of_boards, table_of_player_1, table_of_player_2, index);
bool print_database = false;
vis_cases(zn, index, number_of_states, print_database, table_of_boards, table_of_player_1, table_of_player_2);
if (print_database)
{
clrscr();
PlayersDatabase* database = create_database();
database_functionality(database);
return;
}
}