|
|
@ -1,8 +1,7 @@ |
|
|
|
#include "word_selector.h" |
|
|
|
#include "playHangman.h" |
|
|
|
|
|
|
|
// easy words |
|
|
|
const char wordsList_easy[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
char wordsList_easy[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
"apple", |
|
|
|
"world", |
|
|
|
"banana", |
|
|
@ -26,7 +25,7 @@ const char wordsList_easy[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
}; |
|
|
|
|
|
|
|
// hard words |
|
|
|
const char wordsList_hard[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
char wordsList_hard[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
"database", |
|
|
|
"programming", |
|
|
|
"mountain", |
|
|
@ -49,7 +48,7 @@ const char wordsList_hard[NUM_WORDS][MAX_WORD_LENGTH + 1] = { |
|
|
|
"quarter" |
|
|
|
}; |
|
|
|
|
|
|
|
const char* selectRandomWord(int difficulty) { |
|
|
|
char* selectRandomWord(int difficulty) { |
|
|
|
|
|
|
|
// pick a random number and assign it to index of wordsList_easy array |
|
|
|
srand((unsigned int)time(NULL)); |
|
|
|