fixed logic error in 'checkIfPositionIsFree' in game.c and updated some comments in game.c and main.c

This commit is contained in:
Jonas Hofmann 2025-10-28 08:46:26 +01:00
parent 2f625c98b9
commit d1fd9b38ea
2 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@
#define EMPTY_CHAR 0 #define EMPTY_CHAR 0
//TODO: Spiellogik implementieren: //DONE: Spiellogik implementieren:
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren /* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
* restliche Felder mit zufälligen Buchstaben füllen */ * restliche Felder mit zufälligen Buchstaben füllen */
@ -72,7 +72,7 @@ int checkIfPositionIsFree(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]
// by scanning each row in the given Column // by scanning each row in the given Column
for (i = position.startingCell; (i < serchFieldLen) && !(letterFound); i++) for (i = position.startingCell; (i < serchFieldLen) && !(letterFound); i++)
{ {
if ((salad[position.rowOrColumn][i] >= 'A') && (salad[position.rowOrColumn][i] <= 'z')) if ((salad[i][position.rowOrColumn] >= 'A') && (salad[i][position.rowOrColumn] <= 'z'))
{ {
letterFound = 1; letterFound = 1;
} }