-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (43 loc) · 892 Bytes
/
Copy pathmain.cpp
File metadata and controls
50 lines (43 loc) · 892 Bytes
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
/**
* @mainpage Reversi Game project Documentation
*
* Welcome to the documentation for Reversi Game Project.
*
*/
#include "ReversiConsoleView.h"
using namespace std;
// Main program
int main()
{
ReversiBoard Board;
ReversiConsoleView ViewBoard(&Board);
cout<<endl<<"Game starts..."<<endl;
cout << "=========" << endl;
ViewBoard.print();
int row = 0;
int col = 0;
int player = 0;
while (1)
{
cout << "Enter player number (1 or 2) and any other number"
" to quit: " << endl;
cin >> player;
if (player == 1)
{
cout << "Enter row and column " << endl;
cin >> row >> col;
Board.setState(ReversiBoard::P1_DISK, row, col);
ViewBoard.print();
}
else if (player == 2)
{
cout << "Enter row and column " << endl;
cin >> row >> col;
Board.setState(ReversiBoard::P2_DISK, row, col);
ViewBoard.print();
}
else
break;
}
return 0;
}