-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trinity.cpp
74 lines (57 loc) · 1.9 KB
/
Trinity.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include "Engine/GameEngine.h"
#include "MySTL/unordered_map.h"
#include "GameList.h"
// #include "Engine/Player.h"
// #include "Engine/Ai.h"
// #include "TicTacToe/TTT.h"
// #include "TicTacToe/TTTBoard.h"
void play(Unordered_map<std::string , void(*)()> game_collection)
{
std::cout << "Welcome to Generic AI Engine" << std::endl;
std::cout << "Please select the game you want to play" << std::endl;
int wish;
while (true)
{
int count = game_collection.mysize();
//cout<<"Count : "<<count<<endl;
cout << "1. Tic Tac Toe" << endl;
cout << "2. Connect 4" << endl;
cin >> wish;
if(wish == 1 || wish == 2){
break;
}
}
if(wish == 1)
{
game_collection["Tic Tac Toe"]();
}
else if(wish == 2)
{
game_collection["Connect 4"]();
}
}
int main()
{
//Ascii art for "Prototype"
cout<<" _____ _ _ "<<endl;
cout<<" | __ \\ | | | | "<<endl;
cout<<" | |__) | __ ___ | |_ ___ | |_ _ _ _ __ ___ "<<endl;
cout<<" | ___/ '__/ _ \\| __/ _ \\| __| | | | '_ \\ / _ \\ "<<endl;
cout<<" | | | | | (_) | || (_) | |_| |_| | |_) | __/ "<<endl;
cout<<" |_| |_| \\___/ \\__\\___/ \\__|\\__, | .__/ \\___| "<<endl;
cout<<" __/ | | "<<endl;
cout<<" |___/|_| "<<endl;
Unordered_map<std::string, void (*)()> my_game_collection;
my_game_collection.insert("Tic Tac Toe", TTT_Plugin);
my_game_collection.insert("Connect 4", Connect4_Plugin);
play(my_game_collection);
/*
2. Add comments done
3. Private and protected member of the class done
4. Concepts and constraints not used
1. Beutify The Menues and play events, use system cls or clear to remove old boards to be done
5. unordered_map implemntation to be done
*/
return 0;
}