-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
52 lines (50 loc) · 1.2 KB
/
main.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 "board.h"
#include "Drawings.h"
using namespace std;
int main(){
int ok=1;
int bx,by,bn;
Welcome();
char any=_getch();
if(any){
system("cls");
Instructions();
cin>>by>>bx>>bn;
system("cls");
Loading();
Board x(bx, by, bn);
int val=0;
char c='\0';
while(ok){
system("cls");
x.PrintBoard();
c=_getch();
x.UpdateCursor(c);
ok=(c)?1:0;
if(c==' '){
//unsigned int cx,cy; cin>>cx>>cy;
x.SetFlag(x.GetCX(),x.GetCY());
}
if(c==(char)(13)){
//unsigned int cx,cy; cin>>cx>>cy;
x.DiscoverSquare(x.GetCX(),x.GetCY());
}
if(c=='M' || c=='m'){
//unsigned int cx,cy; cin>>cx>>cy;
x.SetMark(x.GetCX(),x.GetCY());
}
if(x.CheckForWin()){
YouWin();
ok=0;
}
if(!x.IsNotOver()){
YouLose();
ok=0;
x.PrintNumbersBoard();
}
}
}
cout<<'\n';
system("pause");
return 0;
}