Files
info2Praktikum-WortsalatMI/Wordsalad/game.c
T
2026-10-19 08:34:21 +02:00

31 lines
977 B
C

#include "game.h"
#include "input.h"
#include <time.h>
#include <stdlib.h>
#include <string.h>
#define MAX_RAND_TRIES_PER_WORD 10
#define EMPTY_CHAR 0
//TODO: Spiellogik implementieren:
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
* restliche Felder mit zufälligen Buchstaben füllen */
// Creates the word salad by placing words randomly and filling empty spaces
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount)
{
srand(time(NULL));
char bustaben[] = "abcdefghijklmnopqrstuvwxyz";
char zufall = bustaben[rand() % 26];
printf("Zufaelliger Bustabe: %c\n", zufall);
const char words[][MAX_WORD_LEN] ={
"Yeti","Nessie","Werwolf","Vampir","Monster","Hydra","Frankenstein","Dracula","KingKong","Gremlin","Kobold","Hexe","Poltergeist","Gespenst,""Oge"
};
unsigned int wordcound = 15;
return 0;
}