-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (36 loc) · 729 Bytes
/
main.cpp
File metadata and controls
47 lines (36 loc) · 729 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
#include <iostream>
#include "Menu.h"
#include "TicTacToe.h"
#include "Snake.h"
enum {
TICTACTOE,
SNAKE,
QUIT
};
int main(int argc, char *argv[]) {
std::vector<std::string> options = {"Tic-Tac-Toe", "Snake", "Quit"};
// vector<string> options = {"New game", "Load game", "Quit"};
Menu mainMenu(options);
while (1) {
int selIndex = mainMenu.run();
switch (selIndex) {
case TICTACTOE: {
TicTacToe game;
game.run();
}
break;
case SNAKE: {
Snake snake;
snake.run();
// mainMenu.clear();
// cout << "Load game selected: press any key to return to main menu...";
// system("pause > nul");
}
break;
default: // QUIT
return 0;
break;
}
}
return 0;
}