Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6f3446fa8d | ||
![]() |
db1e31f237 | ||
![]() |
a9d6d69bc1 |
@ -13,7 +13,7 @@
|
|||||||
// Creates the word salad by placing words randomly and filling empty spaces
|
// 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)
|
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount)
|
||||||
{
|
{
|
||||||
|
Printf("Hello World+1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints the word salad to console
|
// Prints the word salad to console
|
||||||
|
BIN
Start_Windows/input.o
Normal file
BIN
Start_Windows/input.o
Normal file
Binary file not shown.
@ -12,7 +12,7 @@ int main(int argc, char *argv[])
|
|||||||
int exitCode = EXIT_SUCCESS;
|
int exitCode = EXIT_SUCCESS;
|
||||||
|
|
||||||
// Check if the correct number of arguments is provided
|
// Check if the correct number of arguments is provided
|
||||||
if(argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s <path to file with search words>\n", argv[0]);
|
fprintf(stderr, "Usage: %s <path to file with search words>\n", argv[0]);
|
||||||
exitCode = EXIT_FAILURE;
|
exitCode = EXIT_FAILURE;
|
||||||
@ -24,7 +24,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
FILE *file = fopen(argv[1], "r");
|
FILE *file = fopen(argv[1], "r");
|
||||||
|
|
||||||
if(file != NULL)
|
if (file != NULL)
|
||||||
{
|
{
|
||||||
unsigned int placedWords = 0;
|
unsigned int placedWords = 0;
|
||||||
char wordSalad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]; // 2D array to store the word salad
|
char wordSalad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]; // 2D array to store the word salad
|
||||||
@ -40,7 +40,14 @@ int main(int argc, char *argv[])
|
|||||||
// Check if all words were successfully placed
|
// Check if all words were successfully placed
|
||||||
// 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 != placedWords)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error: %u out of %u were placed\n", placedWords, wordCount);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
startGame(wordSalad, SALAD_SIZE, words, placedWords, 800);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g -Wall -I$(raylibfolder)
|
CFLAGS = -g -Wall
|
||||||
LDFLAGS = -lopengl32 -lgdi32 -lwinmm
|
LDFLAGS = -lopengl32 -lgdi32 -lwinmm
|
||||||
BINARIES = ./windows
|
BINARIES = ./windows
|
||||||
|
|
||||||
raylib_folder = ./raylib
|
raylibfolder = ./raylib
|
||||||
unityfolder = ./unity
|
unityfolder = ./unity
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
@ -12,7 +12,6 @@ unityfolder = ./unity
|
|||||||
wordsalad_initial:
|
wordsalad_initial:
|
||||||
$(CC) -o wordsalad_initial $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS)
|
$(CC) -o wordsalad_initial $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS)
|
||||||
|
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Normales Spiel bauen
|
# Normales Spiel bauen
|
||||||
# --------------------------
|
# --------------------------
|
||||||
@ -23,13 +22,13 @@ main.o: main.c
|
|||||||
$(CC) -c $(CFLAGS) main.c
|
$(CC) -c $(CFLAGS) main.c
|
||||||
|
|
||||||
input.o: input.c
|
input.o: input.c
|
||||||
$(CC) -c $(CFLAGS)input.c
|
$(CC) -c $(CFLAGS) input.c
|
||||||
|
|
||||||
game.o: game.c
|
game.o: game.c
|
||||||
$(CC) -c $(CFLAGS) game.c
|
$(CC) -c $(CFLAGS) game.c
|
||||||
|
|
||||||
graphicalGame.o: graphicalGame.c
|
graphicalGame.o: graphicalGame.c
|
||||||
$(CC) -I$(raylib_folder) -c $(CFLAGS) graphicalGame.c
|
$(CC) -I$(raylibfolder) -c $(CFLAGS) graphicalGame.c
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
|
BIN
Start_Windows/wordsalad_initial.exe
Normal file
BIN
Start_Windows/wordsalad_initial.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user