-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicTacToe.h
More file actions
32 lines (27 loc) · 873 Bytes
/
TicTacToe.h
File metadata and controls
32 lines (27 loc) · 873 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
/**
*header file of class TicTacToe
*Authors Alexey Titov and Shir Bentabou
*Version 1.0
**/
#pragma once
//libraries
#include "Board.h"
#include "Player.h"
using namespace std;
class TicTacToe{
public:
int size;
Board gameBoard;
Player *champ;
public:
//Constructor
TicTacToe(int s);
//This functions checks if the game is over - if a player won or if there was a tie (board is full)
int gameover(char ch);
//This function executes a whole game of tic-tac-toe, and uses player and winner functions of this class.
void play(Player& xPlayer, Player& oPlayer);
//This function returns the board when the game has ended
Board board() const;
//This function returns the player that won the game
Player& winner() const;
};