This commit is contained in:
Moritz Hertel 2025-10-28 14:59:25 +01:00
parent 79a20ce714
commit 34f39d4b5c
7 changed files with 424 additions and 4 deletions

1
.vscode/configurationCache.log vendored Normal file
View File

@ -0,0 +1 @@
{"buildTargets":[],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}

6
.vscode/dryrun.log vendored Normal file
View File

@ -0,0 +1,6 @@
make.exe --dry-run --always-make --keep-going --print-directory
make: Entering directory 'c:/Users/Moritz/Documents/Informatik 2 Praktikum/info2Praktikum-WortsalatGruppe1_richtig'
make: Leaving directory 'c:/Users/Moritz/Documents/Informatik 2 Praktikum/info2Praktikum-WortsalatGruppe1_richtig'
make: *** No targets specified and no makefile found. Stop.

282
.vscode/targets.log vendored Normal file
View File

@ -0,0 +1,282 @@
make.exe all --print-data-base --no-builtin-variables --no-builtin-rules --question
# GNU Make 4.4.1
# Built for Windows32
# Copyright (C) 1988-2023 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
# Make data base, printed on Tue Oct 28 13:38:15 2025
# Variables
# environment
SYSTEMDRIVE = C:
# environment
LC_ALL = C
# environment
USERPROFILE = C:\Users\Moritz
# environment
LOCALAPPDATA = C:\Users\Moritz\AppData\Local
# environment
VSCODE_CRASH_REPORTER_PROCESS_TYPE = extensionHost
# environment
VSCODE_CWD = C:\Program Files\Microsoft VS Code
# environment
CHOCOLATEYINSTALL = C:\ProgramData\chocolatey
# environment
SYSTEMROOT = C:\Windows
# environment
PROCESSOR_LEVEL = 25
# environment
PSMODULEPATH = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
# default
MAKE_COMMAND := C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe
# automatic
@D = $(patsubst %/,%,$(patsubst %\,%,$(dir $@)))
# environment
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_9148_ARFCBCRJZHAKAMQX
# environment
VSCODE_HANDLES_UNCAUGHT_ERRORS = true
# default
.VARIABLES :=
# automatic
%D = $(patsubst %/,%,$(patsubst %\,%,$(dir $%)))
# automatic
^D = $(patsubst %/,%,$(patsubst %\,%,$(dir $^)))
# automatic
%F = $(notdir $%)
# environment
VSCODE_CODE_CACHE_PATH = C:\Users\Moritz\AppData\Roaming\Code\CachedData\7d842fb85a0275a4a8e4d7e040d2625abbf7f084
# environment
LANG = C
# default
.L
make: *** No rule to make target 'all'. Stop.
OADED :=
# environment
TMP = C:\Users\Moritz\AppData\Local\Temp
# default
.INCLUDE_DIRS := .
# environment
PROCESSOR_ARCHITEW6432 = AMD64
# makefile
MAKEFLAGS = pqrR
# environment
ONEDRIVE = C:\Users\Moritz\OneDrive
# makefile
CURDIR := c:/Users/Moritz/Documents/Informatik 2 Praktikum/info2Praktikum-WortsalatGruppe1_richtig
# environment
APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = true
# automatic
*D = $(patsubst %/,%,$(patsubst %\,%,$(dir $*)))
# environment
PROGRAMFILES = C:\Program Files (x86)
# environment
MFLAGS = -pqrR
# default
.SHELLFLAGS := -c
# environment
COMMONPROGRAMW6432 = C:\Program Files\Common Files
# automatic
+D = $(patsubst %/,%,$(patsubst %\,%,$(dir $+)))
# makefile
MAKEFILE_LIST :=
# automatic
@F = $(notdir $@)
# environment
VSCODE_PID = 9148
# automatic
?D = $(patsubst %/,%,$(patsubst %\,%,$(dir $?)))
# environment
__PSLOCKDOWNPOLICY = 0
# automatic
*F = $(notdir $*)
# automatic
<D = $(patsubst %/,%,$(patsubst %\,%,$(dir $<)))
# environment
VSCODE_NLS_CONFIG = {"userLocale":"en-us","osLocale":"de-de","resolvedLanguage":"en","defaultMessagesFile":"C:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\nls.messages.json","locale":"en-us","availableLanguages":{}}
# default
MAKE_HOST := Windows32
# environment
PROGRAMDATA = C:\ProgramData
# default
SHELL := sh.exe
# environment
HOMEPATH = \Users\Moritz
# default
MAKECMDGOALS := all
# environment
DRIVERDATA = C:\Windows\System32\Drivers\DriverData
# environment
COMSPEC = C:\Windows\system32\cmd.exe
# environment
WINDIR = C:\Windows
# environment
MAKELEVEL := 0
# default
MAKE = $(MAKE_COMMAND)
# environment
PATH = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\msys64\ucrt64\bin;C:\Program Files\Microsoft VS Code\bin;C:\ProgramData\mingw64\mingw64\bin;C:\Users\Moritz\AppData\Local\Programs\Python\Launcher\;C:\Users\Moritz\AppData\Local\Microsoft\WindowsApps;;C:\intelFPGA_lite\18.1\modelsim_ase\win32aloem
# environment
COMPUTERNAME = DESKTOP-TV1DOMD
# default
MAKEFILES :=
# automatic
^F = $(notdir $^)
# environment
PROMPT = $P$G
# environment
CHOCOLATEYLASTPATHUPDATE = 134060496987803747
# environment
APPLICATION_INSIGHTS_NO_STATSBEAT = true
# environment
LOGONSERVER = \\DESKTOP-TV1DOMD
# environment
QSYS_ROOTDIR = C:\intelFPGA_lite\18.1\quartus\sopc_builder\bin
# environment
USERNAME = Moritz
# environment
COMMONPROGRAMFILES = C:\Program Files (x86)\Common Files
# automatic
?F = $(notdir $?)
# environment
PROGRAMW6432 = C:\Program Files
# environment
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
# automatic
+F = $(notdir $+)
# environment
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
# environment
USERDOMAIN = DESKTOP-TV1DOMD
# 'override' directive
GNUMAKEFLAGS :=
# environment
OS = Windows_NT
# makefile
.DEFAULT_GOAL :=
# default
MAKE_VERSION := 4.4.1
# environment
PROGRAMFILES(X86) = C:\Program Files (x86)
# environment
USERDOMAIN_ROAMINGPROFILE = DESKTOP-TV1DOMD
# environment
NUMBER_OF_PROCESSORS = 12
# environment
PUBLIC = C:\Users\Public
# environment
QUARTUS_ROOTDIR = C:\intelFPGA_lite\18.1\quartus
# environment
SOPC_KIT_NIOS2 = C:\intelFPGA_lite\18.1\nios2eds
# environment
APPDATA = C:\Users\Moritz\AppData\Roaming
# environment
HOMEDRIVE = C:
# environment
PROCESSOR_ARCHITECTURE = x86
# environment
COMMONPROGRAMFILES(X86) = C:\Program Files (x86)\Common Files
# environment
ELECTRON_RUN_AS_NODE = 1
# environment
TEMP = C:\Users\Moritz\AppData\Local\Temp
# environment
VSCODE_IPC_HOOK = \\.\pipe\14d1de4b-1.105.1-main-sock
# default
.RECIPEPREFIX :=
# automatic
<F = $(notdir $<)
# default
SUFFIXES :=
# environment
ALLUSERSPROFILE = C:\ProgramData
# environment
SESSIONNAME = Console
# default
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell nocomment grouped-target extra-prereqs notintermediate shell-export archives jobserver output-sync load dospaths
# environment
PROCESSOR_REVISION = 5000
# environment
VSCODE_ESM_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
# environment
PROCESSOR_IDENTIFIER = AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD
# variable set hash-table stats:
# Load=95/1024=9%, Rehash=0, Collisions=8/120=7%
# Pattern-specific Variable Values
# No pattern-specific variable values.
# Directories
# . (key c:/Users/Moritz/Documents/Informatik 2 Praktikum/info2Praktikum-WortsalatGruppe1_richtig, mtime 1761578721): 11 files, no impossibilities.
# 11 files, no impossibilities in 1 directories.
# Implicit Rules
# No implicit rules.
# Files
# Not a target:
Makefile:
# Implicit rule search has been done.
# File does not exist.
# File has been updated.
# Failed to be updated.
# Not a target:
.DEFAULT:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# Not a target:
all:
# Command line target.
# Implicit rule search has been done.
# File does not exist.
# File has not been updated.
# Not a target:
makefile:
# Implicit rule search has been done.
# File does not exist.
# File has been updated.
# Failed to be updated.
# Not a target:
makefile.mak:
# Implicit rule search has been done.
# File does not exist.
# File has been updated.
# Failed to be updated.
# Not a target:
GNUmakefile:
# Implicit rule search has been done.
# File does not exist.
# File has been updated.
# Failed to be updated.
# files hash-table stats:
# Load=7/1024=1%, Rehash=0, Collisions=0/17=0%
# VPATH Search Paths
# No 'vpath' search paths.
# No general ('VPATH' variable) search path.
# strcache buffers: 1 (0) / strings = 18 / storage = 209 B / avg = 11 B
# current buf: size = 8174 B / used = 209 B / count = 18 / avg = 11 B
# strcache performance: lookups = 21 / hit rate = 14%
# hash-table stats:
# Load=18/8192=0%, Rehash=0, Collisions=0/21=0%
# Finished Make data base on Tue Oct 28 13:38:15 2025

View File

@ -13,11 +13,80 @@
// 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)
{
//Spielfeld vorbereiten
for(unsigned int i = 0; i < searchFieldLen; i++ ){
for(unsigned int j = 0; j < searchFieldLen; j++ ){
salad[i][j] = EMPTY_CHAR;
}
}
for (unsigned int w = 0; w < wordCount; w++){
size_t len = strlen(words[w]);
int placed = 0;
for(int attempt = 0; attempt < MAX_RAND_TRIES_PER_WORD && !placed; attempt++){
int horizontal = rand() % 2;
int row = rand() % searchFieldLen;
int col = rand() % searchFieldLen;
if(horizontal){
if(col + len > searchFieldLen) continue;
int conflict = 0;
for(size_t i = 0; i < len; i++){
if(salad[row][col+i] != EMPTY_CHAR && salad[row][col+i] != words[w][i]){
conflict = 1;
break;
}
}
if(conflict) continue;
for(size_t i = 0; i < len; i++){
salad[row][col+i] = words[w][i];
}
placed = 1;
}
else{
if(row + len > searchFieldLen) continue;
int conflict = 0;
for(size_t i = 0; i < len; i++){
if(salad[row+1][col] != EMPTY_CHAR && salad[row+1][col] != words[w][i]){
conflict = 1;
break;
}
}
if(conflict) continue;
for(size_t i = 0; i < len; i++){
salad[row+1][col] = words[w][i];
}
placed = 1;
}
}
}
/* code */
//leere Felder mit zufälligen Buchstaben befüllen
for(unsigned int i = 0; i < searchFieldLen; i++ ){
for(unsigned int j = 0; j < searchFieldLen; j++ ){
if (salad[i][j] == EMPTY_CHAR) {
salad[i][j] = 'A' + rand() % 26;
}
}
}
}
// Prints the word salad to console
void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen)
{
for (int i=0; i < searchFieldLen; i++) {
for (int j=0; j < searchFieldLen; j++) {
printf("$c",salad[i][j]);
printf(" ");
}
printf ("\n");
}
}

BIN
Start_Mac/runTests.exe Normal file

Binary file not shown.

View File

@ -13,7 +13,70 @@
// 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)
{
//Spielfeld vorbereiten
for(unsigned int i = 0; i < searchFieldLen; i++ ){
for(unsigned int j = 0; j < searchFieldLen; j++ ){
salad[i][j] = EMPTY_CHAR;
}
}
for (unsigned int w = 0; w < wordCount; w++){
size_t len = strlen(words[w]);
int placed = 0;
for(int attempt = 0; attempt < MAX_RAND_TRIES_PER_WORD && !placed; attempt++){
int horizontal = rand() % 2;
int row = rand() % searchFieldLen;
int col = rand() % searchFieldLen;
if(horizontal){
if(col + len > searchFieldLen) continue;
int conflict = 0;
for(size_t i = 0; i < len; i++){
if(salad[row][col+i] != EMPTY_CHAR && salad[row][col+i] != words[w][i]){
conflict = 1;
break;
}
}
if(conflict) continue;
for(size_t i = 0; i < len; i++){
salad[row][col+i] = words[w][i];
}
placed = 1;
}
else{
if(row + len > searchFieldLen) continue;
int conflict = 0;
for(size_t i = 0; i < len; i++){
if(salad[row+1][col] != EMPTY_CHAR && salad[row+1][col] != words[w][i]){
conflict = 1;
break;
}
}
if(conflict) continue;
for(size_t i = 0; i < len; i++){
salad[row+1][col] = words[w][i];
}
placed = 1;
}
}
}
/* code */
//leere Felder mit zufälligen Buchstaben befüllen
for(unsigned int i = 0; i < searchFieldLen; i++ ){
for(unsigned int j = 0; j < searchFieldLen; j++ ){
if (salad[i][j] == EMPTY_CHAR) {
salad[i][j] = 'A' + rand() % 26;
}
}
}
}
// Prints the word salad to console
@ -27,4 +90,3 @@ void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
printf ("\n");
}
}

Binary file not shown.