SourceCode.docx - #include <iostream>#include <cstdlib>#include<ctime>#include <string>#include <random> using namespace std int NUM_TRY = 7 int

SourceCode.docx - #include <iostream>#include...

This preview shows page 1 - 6 out of 15 pages.

#include <iostream>#include <cstdlib>#include<ctime>#include <string>#include <random>using namespace std;int NUM_TRY = 7;int difficulty;int checkGuess (char, string, string &);void main_menu ();string message = "Play!";intmain (int argc, char *argv[]){string name;char letter;string eword, mword, hword, word;cout << "\t\tPick a difficulty( 1 for easy,2 for medium & 3 for hard)" <<endl;cin >> difficulty;while (difficulty <= 0 || 3 < difficulty){
cout << "\n\t\t\tplease enter a valid value";cin >> difficulty;}if (difficulty == 1){cout << "\t\t\t\tDifficulty:Easy";string ewords[] = {"mario","link","yoshi","kirby","fox","luigi","ness","peach","daisy","sheik","zelda","pichu","falco","marth","roy","chrom","pit","wario",
"snake","ike","lucas","sonic","rob","wolf","shulk","ryu","ken","cloud","simon","joker","hero","terry","samus","robin"};random_device rd;mt19937 eng (rd ());uniform_int_distribution <> distr (1, 33);int n = 0;n = distr (eng);;word = ewords[n];}else if (difficulty == 2)
{cout << "\t\t\t\tDifficulty:Medium";string mwords[] = {"pikachu","jigglypuff","bowser","lucina","ganondorf","mewtwo","lucario","olimar","villager","greninja","palutena","corrin","bayonetta","inkling","ridley","richter","incineroar","isabelle"};random_device rd;mt19937 eng (rd ());uniform_int_distribution <> distr (1, 17);
int n = 0;n = distr (eng);;word = mwords[n];}

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture