generated from freudenreichan/info2Praktikum-Wortsalat
Code game.c
This commit is contained in:
parent
096d400a40
commit
d9c39024bb
@ -29,6 +29,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for (int j = 0; j < searchFieldLen; j++)
|
||||
{
|
||||
salad[i][j] = '\0';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,11 +36,20 @@ int main(int argc, char *argv[])
|
||||
// Create the word salad by placing words into grid
|
||||
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
||||
|
||||
// TODO:
|
||||
|
||||
// Check if all words were successfully placed
|
||||
// Start the game if successful
|
||||
// error message if some words couldn't be placed
|
||||
|
||||
if (placedWords == wordCount)
|
||||
{
|
||||
startGame(wordSalad, SALAD_SIZE, words, placedWords, 800);
|
||||
}
|
||||
else{
|
||||
printf("The game can not start! %d words can not be placed!", wordCount - placedWords);
|
||||
exitCode = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user