File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include " table.hpp"
4+ /* *
5+ * @brief Legal moves are marked with LEGAL
6+ * @param none
7+ * @return nothing
8+ */
9+ void Table::marker ()
10+ {
11+ // unmarkes all the old marked squares
12+ // ///////////////////////////////////////////////////
13+ for (int row = 0 ; row < SIZE; row++)
14+ {
15+ for (int col = 0 ; col < SIZE; col++)
16+ {
17+ if (this ->board [row][col] == LEGAL)
18+ this ->board [row][col] = EMPTY;
19+ }
20+ }
21+ // ///////////////////////////////////////////////////
22+
23+ // marks all the legal squares for the current player
24+ // ///////////////////////////////////////////////////
25+ coor c;
26+ // all the squares are checked
27+ for (int row = 0 ; row < SIZE; row++)
28+ {
29+ for (int col = 0 ; col < SIZE; col++)
30+ {
31+ c.row = row;
32+ c.col = col;
33+ if (isLegal (c))
34+ this ->board [c.row ][c.col ] = LEGAL;
35+ }
36+ }
37+ // ///////////////////////////////////////////////////
38+ }
You can’t perform that action at this time.
0 commit comments