From ff7d0ffa7a4c3580ebc75cf443a578ac75483cfd Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Wed, 11 Mar 2015 16:00:43 +0100 Subject: [PATCH] Fix: finding moves doesn't end at the end of row/col --- players/playerlib.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/players/playerlib.cc b/players/playerlib.cc index 9872da2..b8074b1 100644 --- a/players/playerlib.cc +++ b/players/playerlib.cc @@ -67,10 +67,10 @@ fillMovesList(cell (*field)[fieldWidth], movesList *moves, size_t row, size_t co int findHorizontalForwardMoves(cell (*field)[fieldWidth], movesList *moves) { - //Anzahl eigener/gegnerischer Steine - unsigned int ownCount = 0, enemyCount = 0; for (size_t row = 0;row < fieldHeight; ++row) { + //Anzahl eigener/gegnerischer Steine + unsigned int ownCount = 0, enemyCount = 0; for (size_t col = 0;col < fieldWidth; ++col) { fillMovesList(field, moves, row, col, &ownCount, &enemyCount); @@ -81,10 +81,10 @@ findHorizontalForwardMoves(cell (*field)[fieldWidth], movesList *moves) { int findHorizontalBackwardMoves(cell (*field)[fieldWidth], movesList *moves) { - //Anzahl eigener/gegnerischer Steine - unsigned int ownCount = 0, enemyCount = 0; for (int row = 7; row >= 0; --row) { + //Anzahl eigener/gegnerischer Steine + unsigned int ownCount = 0, enemyCount = 0; for (int col = 7; col >= 0; --col) { fillMovesList(field, moves, row, col, &ownCount, &enemyCount); @@ -95,10 +95,10 @@ findHorizontalBackwardMoves(cell (*field)[fieldWidth], movesList *moves) { int findVerticalForwardMoves(cell (*field)[fieldWidth], movesList *moves) { - //Anzahl eigener/gegnerischer Steine - unsigned int ownCount = 0, enemyCount = 0; for (size_t col = 0;col < fieldHeight; ++col) { + //Anzahl eigener/gegnerischer Steine + unsigned int ownCount = 0, enemyCount = 0; for (size_t row = 0;row < fieldWidth; ++row) { fillMovesList(field, moves, row, col, &ownCount, &enemyCount); @@ -109,10 +109,10 @@ findVerticalForwardMoves(cell (*field)[fieldWidth], movesList *moves) { int findVerticalBackwardMoves(cell (*field)[fieldWidth], movesList *moves) { - //Anzahl eigener/gegnerischer Steine - unsigned int ownCount = 0, enemyCount = 0; for (int col = 7; col >= 0; --col) { + //Anzahl eigener/gegnerischer Steine + unsigned int ownCount = 0, enemyCount = 0; for (int row = 7; row >= 0; --row) { fillMovesList(field, moves, row, col, &ownCount, &enemyCount);