#endif
/* module level variables for game control */
-char shuffle[] = "£££££££";
-char answer[] = "£££££££";
-char language[10];
+char shuffle[8] = SPACE_FILLED_CHARS;
+char answer[8] = SPACE_FILLED_CHARS;
+char language[64];
char txt[50];
char* rootWord;
int updateAnswers = 0;
/***********************************************************
synopsis: determine the next blank space in a string
- blanks are indicated by pound £ not space
+ blanks are indicated by pound not space
inputs: pointer the string to check
/***********************************************************
synopsis: determine the next blank space in a string
- blanks are indicated by pound £ not space.
+ blanks are indicated by pound not space.
When a blank is found, move the chosen letter
from one box to the other.
i.e. If we're using the ANSWER box,
for (i=0;i<=filelocation;i++){
- if(fscanf(wordlist, "%s", wordFromList) != EOF){
+ if (fscanf(wordlist, "%s", wordFromList) != EOF) {
/* spin on */
- }
- else{
+ } else {
/* go back to the start of the file */
- fclose(wordlist);
- strcpy(txt,language);
- fopen(strcat(txt,"wordlist.txt"), "r");
+ fseek(wordlist, 0L, SEEK_SET);
}
}
if(fscanf(wordlist, "%s", wordFromList) != EOF){
/* spin on */
- }
- else{
+ } else {
/* go back to the start of the file */
- fclose(wordlist);
- strcpy(txt,language);
- fopen(strcat(txt,"wordlist.txt"), "r");
+ fseek(wordlist, 0L, SEEK_SET);
fscanf(wordlist, "%s", wordFromList);
}
}
return string;
}
-/***********************************************************
-synopsis: working backwards in the string,
- find the first non space character
-
-inputs: a string to check
-
-outputs: the position of the character
-***********************************************************/
-static int
-revFirstNonSpace(const char *thisWord)
-{
- int i;
-
- for (i = strlen(thisWord) ; i>0; i--){
- if (thisWord[i-1] != SPACE_CHAR){
- return i;
- }
- }
-
- return 0;
-}
-
-
-
/***********************************************************
synopsis: replace characters randomly
thisLetter = NULL;
}
else{
- shuffle[i] = '£';
+ shuffle[i] = SPACE_CHAR;
/* rect.x = 26 * GAME_LETTER_WIDTH;*/
}
}
for (i = bigWordLen; i < 7; i++){
- remain[i]='£';
+ remain[i] = SPACE_CHAR;
}
remain[7] = '\0';
free(guess);
free(remain);
- strcpy(answer, "£££££££");
+ strcpy(answer, SPACE_FILLED_STRING);
/* build up the letter sprites */
buildLetters(letters, screen);
/* walk the list, setting everything to found */
solveIt(*head);
clearWord(letters);
- strcpy(shuffle, "£££££££");
+ strcpy(shuffle, SPACE_FILLED_STRING);
strcpy(answer, rootWord);
/*displayLetters(screen);*/
displayAnswerBoxes(*head, screen);