Tests benutzt und Fehler in game.c behoben

This commit is contained in:
sengpielto106561 committed 2026-10-25 19:50:29 +01:00
1 parent ce17403a1b
commit ce4be9f902
2 files changed
+6 -6

No files matched your search

+3 -6
View File
@@ -6,10 +6,7 @@
#define MAX_RAND_TRIES_PER_WORD 10
#define EMPTY_CHAR 0
typedef enum Richtung {
VERTIKAL = 0;
HORIZONTAL = 1;
};
//TODO: Spiellogik implementieren:
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
@@ -51,7 +48,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
int dir = rand() % 2;
if ((MAX_SEARCH_FIELD_LEN - x) < len){
if((MAX_SEARCH_FIELD_LEN - )y < len){
if((MAX_SEARCH_FIELD_LEN - y) < len){
// cant place word here (too far in the bottom right corner)
try++;
continue;
@@ -59,7 +56,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
}
//place word vertically
if(dir == HORIZONTAL){
if(dir == 1){
//see if all neccessary spaces are empty
bool cont = false;
for (int i = 0; i < (int)len; i++){