forked from freudenreichan/info2Praktikum-Wortsalat
Game.c gebaut, noch nicht getestet
Game.c erweitert, Wörter werden platziert, leere Felder mit random Buchstaben aufgefüllt. Kontrollfunktion in Arbeit
This commit is contained in:
1 parent
32c9ae9393
commit
36b381f116
1 file changed
+5
-5
@@ -20,7 +20,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for(col=0; col<MAX_SEARCH_FIELD_LEN; col++)
|
||||
{
|
||||
salad[row][col] = EMPTY_CHAR;
|
||||
control[row][col] = 0;
|
||||
//control[row][col] = 0;
|
||||
//printf("%c", salad[row][col]);
|
||||
}
|
||||
//printf("\n");
|
||||
@@ -34,7 +34,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for (int i=0; i<strlen(words[word]); i++)
|
||||
{
|
||||
salad[startrow][startcol+i] = words[word][i];
|
||||
control[startrow][startcol+i] = 1;
|
||||
//control[startrow][startcol+i] = 1;
|
||||
}
|
||||
}
|
||||
else //vertikal
|
||||
@@ -44,7 +44,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
for (int j=0; j<strlen(words[word]); j++)
|
||||
{
|
||||
salad[startrow+j][startcol] = words[word][j];
|
||||
control[startrow+j][startcol] = 1;
|
||||
//control[startrow+j][startcol] = 1;
|
||||
}
|
||||
}
|
||||
if (rand()%26 !=0)
|
||||
@@ -66,8 +66,8 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
{
|
||||
for (col=0; col<MAX_SEARCH_FIELD_LEN; col++)
|
||||
{
|
||||
//printf("%c", salad[row][col]);
|
||||
printf("%d ", control[row][col]);
|
||||
printf("%c", salad[row][col]);
|
||||
//printf("%d ", control[row][col]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user