Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Write a two-player tic-tac-toe game, allowing two humans to play against each other; use enums when possible to represent the values of the board.
- #include <iostream>
- using namespace std;
- enum {Empty = 100, X_Filled = 101, O_filled = 102};
- enum {Space_1 = 1, Space_2, Space_3, Space_4, Space_5, Space_6, Space_7, Space_8, Space_9};
- void ReturnSpace()
- {
- cout << Space_1;
- }
- void ShowBoard()
- {
- cout << "\t"<<Space_1<<"\t|\t"<<Space_2<<"\t|\t"<<Space_3<<"\n";
- cout << "--------+-------+-------\n";
- cout << "\t"<<Space_4<<"\t|\t"<<Space_5<<"\t|\t"<<Space_6<<"\n";
- cout << "--------+-------+-------\n";
- cout << "\t"<<Space_7<<"\t|\t"<<Space_8<<"\t|\t"<<Space_9<<"\n\n";
- }
- int main()
- {
- int input;
- cin >> input;
- switch(input)
- {
- case 1:
- int Space_1 = 101;
- ReturnSpace();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement