added check of placed Words

This commit is contained in:
Andreas Binner committed 2026-10-29 22:10:33 +01:00
1 parent b685b56273
commit 1a796d8144
1 file changed
+17
+17
View File
@@ -41,6 +41,23 @@ int main(int argc, char *argv[])
// Start the game if successful // Start the game if successful
// error message if some words couldn't be placed // error message if some words couldn't be placed
if(wordCount > 19)
{
if(placedWords != 20)
{
exitCode = EXIT_FAILURE;
printf("Only %d of %d possible words could be placed\n", placedWords, 20);
}
}
else
{
if(placedWords != wordCount)
{
exitCode = EXIT_FAILURE;
printf("Only %d of %d possible words could be placed\n", placedWords, wordCount);
}
}
} }
else else
{ {