Compare commits

..

No commits in common. "1f22de8f99c78f6e7a18d1ed1cbae62d4c9487b2" and "e355223d7c48d2c795745bfde59e621bc90dded6" have entirely different histories.

View File

@ -2,36 +2,14 @@
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "game.h"
#define MAX_RAND_TRIES_PER_WORD 10
#define EMPTY_CHAR '.'
#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 */
static void initializeArray(char salad [MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
unsigned int SearchFieldLen) //Array initialisieren & mit Filler füllen
{
for (int i = 0; i < SearchFieldLen; i++)
{
for (int j = 0; j < MAX_SEARCH_FIELD_LEN; j++)
{
salad[i][j] = EMPTY_CHAR;
}
}
}
static void col_roq (unsigned int searchFieldLen, int *x, int *y) //Zufällige x/y Koordinate für Wortanfang
{
*x = rand() % searchFieldLen;
*y = rand() % searchFieldLen;
}
// 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)
{