Puffer optimiert, Fenstergröße erhöht, Wextra hinzugefügt, Readme erstellt

This commit is contained in:
ahmadiarfi103597 committed 2026-11-03 14:41:22 +01:00
1 parent fb760d76fe
commit d3f131817b
4 files changed
+22 -4

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
{
const char *delim = ", ; \n\t";
char buffer[MAX_WORD_LEN * MAX_WORD_LEN];
char buffer[MAX_WORD_LEN];
int i = 0; // Wort-Zähler
// Prüfen, ob das Lesen erfolgreich war (EOF oder Fehler abfangen)
@@ -22,7 +22,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
// snprintf ist quasi strncpy nur mit \0 und sicher
snprintf(words[i], MAX_WORD_LEN, "%s", wordbuffer);
for (int j=0; words[i][j] != '\0'; j++) {
for (int j=0; words[i][j] != '\0'; j++) { // Alles auf Großbuchstaben
words[i][j] = toupper((unsigned char)words[i][j]);
}
+1 -1
View File
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
if (placedWords == wordCount)
{
startGame(wordSalad, SALAD_SIZE, words, wordCount, 100);
startGame(wordSalad, SALAD_SIZE, words, wordCount, 1000);
} else {
fprintf(stderr, "Es konnten nicht alle Wörter platziert werden :(\n");
exitCode = EXIT_FAILURE;
+1 -1
View File
@@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -g -Wall
CFLAGS = -g -Wall -Wextra
ifeq ($(OS),Windows_NT)
include makefile_windows.variables
+18
View File
@@ -0,0 +1,18 @@
# Wortsalalat Anleitung
## Kompilieren
1. Repo clonen
2. ´make wordsalad´
3. Das Programm ausführen
## Das Programm ausführen
Einfach im Ordner Terminal öffnen und:
´./wordsalad words.txt´
´words.txt´ ist hierbei die Datei mit allen Wörtern
Um Wörter zu trennen benutze ´,´ ´;´ Leerzeichen oder Tabulator oder Zeilenumsprung