Hangman Update But Still Need Help

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
   string words[]={cat, dog, mom, dad, grandma, grandpa, everything, elephant} ;
   srand((unsigned)time(0)) ;
   int pickword=rand()%8+1 ;
   switch (pickword)
   {
      case 1:
         cout<<"***" <<endl ;
         int letter ;
         cout<<"Guess a letter." <<endl ;
         cin>> letter ;

Now I'm really stuck. Please Help! Thank You!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
   string words[]={cat, dog, mom, dad, grandma, grandpa, everything, elephant} ;
   srand((unsigned)time(0)) ;
   int pickword=rand()%8+1 ;
   switch (pickword)
   {
      case 1:
         int guessnumber ;
         cout<<"______" <<endl ;
         cout<<"|         |" <<endl ;
         cout<<"|" <<endl ;
         cout<<"|" <<endl ;
         cout<<"|" <<endl ;
         cout<<"|" <<endl ;
         cout<<"|" <<endl ;
         cout<<"***" <<endl ;
         char letter ;
         cout<<"Guess a letter." <<endl ;
         cin>> letter ;

Now how would I differentiate if letter =c add c, but if a add a, but if I add c take another guess and it is a how will i make if first guess is a put *a*, but if its after c like than its ca*? PLEASE HELP! THANK YOU!
Topic archived. No new replies allowed.