forked from schroederen/info2Praktikum-Wortsalat
main.c fertig angepasst
This commit is contained in:
parent
46a71de3ec
commit
be5b6adc0b
@ -37,10 +37,22 @@ int main(int argc, char *argv[])
|
|||||||
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// Check if all words were successfully placed
|
|
||||||
// Start the game if successful
|
|
||||||
// error message if some words couldn't be placed
|
|
||||||
|
|
||||||
|
// Check if all words were successfully placed
|
||||||
|
if(placedWords == wordCount)
|
||||||
|
{
|
||||||
|
// Start the game if successful
|
||||||
|
printf("All %u words were successfully placed in the word salad!\n", wordCount);
|
||||||
|
createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
|
||||||
|
showWordSalad(wordSalad, SALAD_SIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Error message if some words couldn't be placed
|
||||||
|
fprintf(stderr, "Error: Only %u out of %u words could be placed in the word salad.\n",
|
||||||
|
placedWords, wordCount);
|
||||||
|
exitCode = EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user