|
@@ -93,6 +93,10 @@ void pass(){
|
|
|
overwrite another word or get placed right next to it */
|
|
|
int place;
|
|
|
int takenWords[WORDS_CHOSEN];
|
|
|
+
|
|
|
+ for(int i=0; i<WORDS_CHOSEN; i++)
|
|
|
+ takenWords[i] = 0;
|
|
|
+
|
|
|
int valid;
|
|
|
does not conflict with other words, 0 otherwise */
|
|
|
int pickedWord = 0;
|
|
@@ -108,22 +112,21 @@ void pass(){
|
|
|
for(i=place-1; i<place+WORD_SIZE+1; i++){
|
|
|
if(bigString[i] > 64 && bigString[i] < 91){
|
|
|
valid = 0;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if(valid){
|
|
|
int wordLoc = rand()%WORD_POOL_SIZE;
|
|
|
-
|
|
|
-
|
|
|
- for(i=0;i<=WORDS_CHOSEN-left;i++)
|
|
|
- {
|
|
|
- if(wordLoc == takenWords[i])
|
|
|
- valid = 0;
|
|
|
- }
|
|
|
+
|
|
|
+ if(takenWords[wordLoc])
|
|
|
+ valid=0;
|
|
|
|
|
|
if(valid){
|
|
|
|
|
|
+ takenWords[wordLoc] = 1;
|
|
|
+
|
|
|
|
|
|
for(i=place; i<place+WORD_SIZE; i++){
|
|
|
bigString[i] = *(*(wordArr+wordLoc)+(i-place));
|