game.c verkürzung

This commit is contained in:
hulwaja104499 committed 2026-10-30 22:15:19 +01:00
1 parent 7a7062a925
commit 62da76ef4f
1 file changed
+4 -7
+4 -7
View File
@@ -2,7 +2,6 @@
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h> //für toupper
#define MAX_RAND_TRIES_PER_WORD 10
#define EMPTY_CHAR 0
@@ -87,8 +86,7 @@ int placeWords(unsigned int searchFieldLen, const char *wort, int platzierung, i
for (size_t j = 0; j < len; j++)
{
char c = salad[yKoord][xKoord + j];
char w = (char)toupper((unsigned char)wort[j]); //Umwandlung in Großbuchstaben
if (c != EMPTY_CHAR && c != w)
if (c != EMPTY_CHAR)
{
return 0;
}
@@ -96,7 +94,7 @@ int placeWords(unsigned int searchFieldLen, const char *wort, int platzierung, i
for (size_t j = 0; j < len; j++)
{
salad[yKoord][xKoord + j] = (char)toupper((unsigned char)wort[j]); //Umwandlung in Großbuchstaben
salad[yKoord][xKoord + j] = wort[j];
}
return 1;
@@ -114,8 +112,7 @@ int placeWords(unsigned int searchFieldLen, const char *wort, int platzierung, i
for (size_t j = 0; j < len; j++)
{
char c = salad[yKoord + j][xKoord];
char w = (char)toupper((unsigned char)wort[j]);
if (c != EMPTY_CHAR && c != w)
if (c != EMPTY_CHAR)
{
return 0;
}
@@ -123,7 +120,7 @@ int placeWords(unsigned int searchFieldLen, const char *wort, int platzierung, i
for (size_t j = 0; j < len; j++)
{
salad[yKoord + j][xKoord] = (char)toupper((unsigned char)wort[j]);
salad[yKoord + j][xKoord] = wort[j];
}
return 1;