Advertisement
Guest User

TicTacToe.h

a guest
Nov 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. //--------------------------------------------------------
  2. // Tic-Tac-Toe - TicTacToe.h
  3. //--------------------------------------------------------
  4. // Project: Individual Project Prompt - Tic-Tac-Toe
  5. // By: Shamyak Singh
  6. // Course: CS 371 - Introduction To Computer Networking
  7. // File: main.cpp
  8. // Date: November 19th 2018
  9. // Purpose: The purpose of this project is to play a game
  10. // of Tic-Tac-Toe that can be played remotely by
  11. // using socket programming in order to create a
  12. // client-server application that executes the
  13. // game.
  14. //--------------------------------------------------------
  15.  
  16. // Header File
  17.  
  18. enum Marker {
  19. none, X, O
  20. }
  21.  
  22. class TicTacToe{
  23. public:
  24. TicTacToe();
  25. Marker getPosition(int x, int y);
  26. void setPosition(int x, int y, Marker M);
  27. Marker getWinner();
  28. bool isFull();
  29. bool isGameOver();
  30. void print();
  31. private:
  32. Marker board [3][3];
  33. Marker checkColumnWinner(int column);
  34. Marker checkRowWinner(int row);
  35. Marker checkDiagonalDown();
  36. Marker checkDiagonalUp();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement