Fix: finding moves doesn't end at the end of row/col

master
Trolli Schmittlauch 2015-03-11 16:00:43 +01:00
parent a9399ddf06
commit ff7d0ffa7a
1 changed files with 8 additions and 8 deletions

View File

@ -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);