Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. // 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.
  2.  
  3.  
  4. #include <iostream>
  5.  
  6.  
  7. using namespace std;
  8. enum {Empty = 100, X_Filled = 101, O_filled = 102};
  9. enum {Space_1 = 1, Space_2, Space_3, Space_4, Space_5, Space_6, Space_7, Space_8, Space_9};
  10.  
  11.  
  12. void ReturnSpace()
  13. {
  14. cout << Space_1;
  15. }
  16.  
  17.  
  18. void ShowBoard()
  19. {
  20. cout << "\t"<<Space_1<<"\t|\t"<<Space_2<<"\t|\t"<<Space_3<<"\n";
  21. cout << "--------+-------+-------\n";
  22. cout << "\t"<<Space_4<<"\t|\t"<<Space_5<<"\t|\t"<<Space_6<<"\n";
  23. cout << "--------+-------+-------\n";
  24. cout << "\t"<<Space_7<<"\t|\t"<<Space_8<<"\t|\t"<<Space_9<<"\n\n";
  25. }
  26.  
  27.  
  28. int main()
  29. {
  30.  
  31. int input;
  32. cin >> input;
  33.  
  34.  
  35. switch(input)
  36. {
  37. case 1:
  38. int Space_1 = 101;
  39. ReturnSpace();
  40.  
  41. break;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement