diff --git a/2017/8 April/Solutions/fashion.cpp b/2017/8 April/Solutions/fashion.cpp index 0ff991386eb29e52f7f1712fa950d82ba1559d80..00706de4133a549c50d0ae4213c2fd9a4112f229 100644 --- a/2017/8 April/Solutions/fashion.cpp +++ b/2017/8 April/Solutions/fashion.cpp @@ -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);