Skip to content
Snippets Groups Projects
Commit 03d665ac authored by Tom Almeida's avatar Tom Almeida
Browse files

some modifications to q4 (fashion)

parent d2fa86da
Branches
No related merge requests found
......@@ -41,8 +41,8 @@ int calculateScore(vector<vector<char>>& grid) {
}
bool isLegalRow(vector<vector<char>>& grid, int rowNum) {
bool lastWasOut = false;
for (int i = 0; i < grid.size(); i++) {
bool lastWasOut = false;
char c = grid[rowNum][i];
switch (c) {
case '.':
......@@ -61,13 +61,13 @@ bool isLegalRow(vector<vector<char>>& grid, int rowNum) {
}
bool isLegalColumn(vector<vector<char>>& grid, int columnNum) {
bool lastWasOut = false;
for (int i = 0; i < grid.size(); i++) {
bool lastWasOut = false;
char c = grid[i][columnNum];
switch (c) {
case '.':
continue;
case '+':
case 'x':
case 'o':
if (lastWasOut)
return false;
......@@ -78,10 +78,7 @@ bool isLegalColumn(vector<vector<char>>& grid, int columnNum) {
}
}
return true;
}
bool isLegalDiagonal(vector<vector<char>>& grid, int startColumn, int startRow) {
for (int column = start
}
void doStuff(vector<vector<char>>& grid) {
int score = calculateScore(grid);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment