|
@ -0,0 +1,37 @@ |
|
|
|
|
|
// |
|
|
|
|
|
// Created by Saba Fazlali on 22.01.24. |
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
#include "word_selector.h" |
|
|
|
|
|
|
|
|
|
|
|
const char wordsList[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
|
|
"skill", |
|
|
|
|
|
"world", |
|
|
|
|
|
"difference", |
|
|
|
|
|
"celebration", |
|
|
|
|
|
"association", |
|
|
|
|
|
"customer", |
|
|
|
|
|
"mood", |
|
|
|
|
|
"agreement", |
|
|
|
|
|
"audience", |
|
|
|
|
|
"professor", |
|
|
|
|
|
"year", |
|
|
|
|
|
"dealer", |
|
|
|
|
|
"patience", |
|
|
|
|
|
"initiative", |
|
|
|
|
|
"pollution", |
|
|
|
|
|
"awareness", |
|
|
|
|
|
"problem", |
|
|
|
|
|
"vehicle", |
|
|
|
|
|
"death", |
|
|
|
|
|
"cousin" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const char* selectRandomWord() { |
|
|
|
|
|
|
|
|
|
|
|
// pick a random number and assign it to index of wordsList array |
|
|
|
|
|
srand((unsigned int)time(NULL)); |
|
|
|
|
|
int randomIndex = rand() % NUM_WORDS; |
|
|
|
|
|
|
|
|
|
|
|
return wordsList[randomIndex]; |
|
|
|
|
|
} |