forked from freudenreichan/info2Praktikum-Wortsalat
Funktioniert
This commit is contained in:
1 parent
6c72054f42
commit
b0951bcb45
3 files changed
+34
-10
No files matched your search
+2
-2
@@ -50,8 +50,8 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for(int j = 0; j < strlen(words[i]); j++){
|
||||
salad[startpoint_x + j][startpoint_y] = words[i][j];
|
||||
}
|
||||
break;
|
||||
wordsplaced += 1;
|
||||
break;
|
||||
case 1: //X-Negativ
|
||||
startpoint_x = strlen(words[i]) - 1 + rand() % (searchFieldLen - strlen(words[i]) + 1);
|
||||
startpoint_y = rand() % searchFieldLen;
|
||||
@@ -70,8 +70,8 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for(int j = 0; j < strlen(words[i]); j++){
|
||||
salad[startpoint_x - j][startpoint_y] = words[i][j];
|
||||
}
|
||||
break;
|
||||
wordsplaced += 1;
|
||||
break;
|
||||
case 2: //Y-Positiv
|
||||
startpoint_x = rand() % searchFieldLen;
|
||||
startpoint_y = rand() % (searchFieldLen - strlen(words[i]) + 1);
|
||||
|
||||
Reference in new issue
Block a user