Trabalho Prático - PDS2
Carregando...
Procurando...
Nenhuma entrada encontrado
TTT.hpp
1#ifndef TTT_HPP
2#define TTT_HPP
3
4#include <iostream>
5
6#include "game.hpp"
7#include "string_utils.hpp"
8#include "exceptions.hpp"
9
10class TTT : public Game {
11 private:
12 void validateMove(int row, int col);
13
14 int checkLine(bool isRow);
15
16 int checkRows();
17
18 int checkColumns();
19
20 int checkDiagonals();
21
22 public:
23
24 TTT();
25
26 void readMove() override;
27
28 void makeMove() override;
29
30 char isGameFinished() override;
31
32 //void printBoard() override;
33};
34
35#endif
Definição game.hpp:9
Definição TTT.hpp:10
char isGameFinished() override
Checks the current state of the game to determine if it has finished.
Definição TTT.cpp:140
int checkLine(bool isRow)
Checks if there is a winning line (row or column) in the Tic-Tac-Toe board.
Definição TTT.cpp:79
int checkRows()
Checks the rows in the Tic-Tac-Toe game for a win condition.
Definição TTT.cpp:97
int checkColumns()
Checks the columns in the game.
Definição TTT.cpp:106
void makeMove() override
Makes a move in the Tic-Tac-Toe game.
Definição TTT.cpp:62
TTT()
Constructs a TTT (Tic-Tac-Toe) game object.
Definição TTT.cpp:6
int checkDiagonals()
Checks the diagonals of the Tic-Tac-Toe board to determine if there is a winner.
Definição TTT.cpp:120
void readMove() override
Reads a move from the user and validates it.
Definição TTT.cpp:13
void validateMove(int row, int col)
Validates a move in the Tic-Tac-Toe game.
Definição TTT.cpp:46