generated from freudenreichan/info2Praktikum-Wortsalat
feat(main): Implement Game starting logic
This commit is contained in:
1 parent
38a85ac174
commit
94262261fe
1 file changed
+10
-5
+10
-5
@@ -35,11 +35,16 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Create the word salad by placing words into grid
|
// Create the word salad by placing words into grid
|
||||||
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
||||||
|
|
||||||
// TODO:
|
if (wordCount == placedWords)
|
||||||
// Check if all words were successfully placed
|
{
|
||||||
// Start the game if successful
|
startGame(wordSalad, SALAD_SIZE, words, wordCount, 1000);
|
||||||
// error message if some words couldn't be placed
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Not all words could be placed in the grid.\nOnly %d of %d could be placed", placedWords, wordCount);
|
||||||
|
exitCode = EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user