generated from freudenreichan/info2Praktikum-Wortsalat
fixed logic error in 'checkIfPositionIsFree' in game.c and updated some comments in game.c and main.c
This commit is contained in:
parent
2f625c98b9
commit
d1fd9b38ea
@ -7,7 +7,7 @@
|
||||
#define EMPTY_CHAR 0
|
||||
|
||||
|
||||
//TODO: Spiellogik implementieren:
|
||||
//DONE: Spiellogik implementieren:
|
||||
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
|
||||
* 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
|
||||
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;
|
||||
}
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
#define SALAD_SIZE 20
|
||||
|
||||
// selbstgeschriebene Definitionen:
|
||||
// annahmen ist das windowWidth in pixeln gegeben
|
||||
// werden muss, da auch andere funktionen wie
|
||||
// createCharSquarePanel in Pixeln arbeiten
|
||||
// annahmen ist das windowWidth in pixeln gegeben
|
||||
// werden muss, da auch andere funktionen wie
|
||||
// createCharSquarePanel in Pixeln arbeiten
|
||||
#define WINDOW_WIDTH 540
|
||||
|
||||
|
||||
@ -57,8 +57,8 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
// annahme: windowWidth wird in Pixeln gesucht,
|
||||
// da auch andere funktionen, wie createCharSquarePanel
|
||||
// in Pixeln arbeiten
|
||||
// da auch andere funktionen, wie createCharSquarePanel
|
||||
// in Pixeln arbeiten
|
||||
startGame(wordSalad, MAX_SEARCH_FIELD_LEN, words, placedWords, WINDOW_WIDTH);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user