Skip to content

Instantly share code, notes, and snippets.

@Sadin
Created November 9, 2016 02:56
Show Gist options
  • Save Sadin/3a589daecfca2bf9a78af1b4e83f0b79 to your computer and use it in GitHub Desktop.
Save Sadin/3a589daecfca2bf9a78af1b4e83f0b79 to your computer and use it in GitHub Desktop.
<21:54:50> "Kria": yo zach does this look right
<21:55:22> "Kria": it generates a character list of a specified amount of letters to later be used in the creation of a boggle board
<21:55:31> "Kria": char* Game::getLetters(int x){
char letters[x];
int random;
char vowelList[5] = "AEIOU";
char consList[21] = "BCDFGHJKLMNPQRSTVWXYZ";
int vowels = rand() % x + 1;
for (int i = 0;i<vowels;i++) {
random = rand() % 5;
letters = vowelList[random];
} // end for
for (int i = vowels;i<x;i++) {
random = rand() % 21;
letters = consList[random];
} // end for
return letters;
}
<21:55:43> "Kria": <3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment