generated from freudenreichan/info2Praktikum-Wortsalat
Letzter Feinschliff
This commit is contained in:
1 parent
26cbcd17e6
commit
7f3e18becf
3 files changed
+13
-7
No files matched your search
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define MAX_RAND_TRIES_PER_WORD 10
|
#define MAX_RAND_TRIES_PER_WORD 100
|
||||||
#define EMPTY_CHAR 0
|
#define EMPTY_CHAR 0
|
||||||
|
|
||||||
// TODO: Spiellogik implementieren:
|
// TODO: Spiellogik implementieren:
|
||||||
|
|||||||
+4
-5
@@ -9,7 +9,7 @@
|
|||||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
unsigned int i = 0; // Wort
|
unsigned int i = 0; // Wort
|
||||||
unsigned int j = 0; // Zeichen im Wort
|
unsigned int j = 0; // Zeichen im Wort
|
||||||
|
|
||||||
while ((c = fgetc(file)) != EOF)
|
while ((c = fgetc(file)) != EOF)
|
||||||
@@ -18,9 +18,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
{
|
{
|
||||||
if (j > 0)
|
if (j > 0)
|
||||||
{
|
{
|
||||||
words[i][j] = '\0';
|
words[i][j] = '\0';
|
||||||
i++;
|
i++;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
if (i >= maxWordCount)
|
if (i >= maxWordCount)
|
||||||
{
|
{
|
||||||
@@ -53,6 +53,5 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
printf("%u. Entry: %s\n", idx + 1, words[idx]);
|
printf("%u. Entry: %s\n", idx + 1, words[idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (int)i;
|
return (int)i;
|
||||||
}
|
}
|
||||||
+8
-1
@@ -41,13 +41,20 @@ graphicalGame.o: $(codefolder)/graphicalGame.c
|
|||||||
$(CC) -I$(raylibfolder) -c $(CFLAGS) $(codefolder)/graphicalGame.c
|
$(CC) -I$(raylibfolder) -c $(CFLAGS) $(codefolder)/graphicalGame.c
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------
|
||||||
|
# Unser Spiel bauen
|
||||||
|
# --------------------------
|
||||||
|
wordsalad_ourVersion: main.o graphicalGame.o $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a
|
||||||
|
$(CC) $(CFLAGS) -o wordsalad_ourVersion main.o graphicalGame.o $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS)
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
# --------------------------
|
# --------------------------
|
||||||
TEST_BIN = runTests
|
TEST_BIN = runTests
|
||||||
|
|
||||||
test: input.o game.o $(codefolder)/unit_tests.c $(unityfolder)/unity.c
|
test: input.o game.o $(codefolder)/unit_tests.c $(unityfolder)/unity.c
|
||||||
$(CC) -Wall -I$(unityfolder) -o $(TEST_BIN) input.o game.o $(codefolder)/unit_tests.c $(unityfolder)/unity.c
|
$(CC) $(CFLAGS) -I$(unityfolder) -o $(TEST_BIN) input.o game.o $(codefolder)/unit_tests.c $(unityfolder)/unity.c
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Clean
|
# Clean
|
||||||
# --------------------------
|
# --------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user