c++
Denise.. You've been asking is C++ Programming hard.. Well, I can't say it's easy or it's hard. But I think I'll let you decide.. Below is the coding for a simple hangman game..



C++ coding:

//HANGMAN GAME


#include


void main()

{
int x=1,h=0,y=1,a;
char Answer[9]="sweater",ccb;
Answer[0]='*';
Answer[1]='*';
Answer[2]='*';
Answer[3]='*';
Answer[4]='*';
Answer[5]='*';
Answer[6]='*';


cout <<"===========================" << endl;
cout <<"Welcome to my hangman game" << endl;
cout <<"===========================" << endl;
cout << "Word=" << Answer << endl;


while((x<7)&&(y<10))
{
cout << "Guess A Letter:" << endl;
cin >> ccb;


switch(ccb)
{
case's':
Answer[0]='s';
cout << Answer << endl;
x++;
break;

case'w':
Answer[1]='w';
cout << Answer << endl;
x++;
break;

case'e':
Answer[2]='e';
Answer[5]='e';
cout << Answer << endl;
x++;
break;

case'a':
Answer[3]='a';
cout << Answer << endl;
x++;
break;

case't':
Answer[4]='t';
cout << Answer << endl;
x++;
break;

case'r':
Answer[6]='r';
cout << Answer << endl;
x++;
break;

default:
if (y==1)
{
cout << " +-----+ " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:7" << endl;
cout << Answer << endl;
}

else if (y==2)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:6" << endl;
cout << Answer << endl;
}

else if (y==3)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:5" << endl;
cout << Answer << endl;
}

else if (y==4)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | | " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:4" << endl;
cout << Answer << endl;
}

else if (y==5)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | /| " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:3" << endl;
cout << Answer<< endl;
}

else if (y==6)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | /|\\ " << endl;
cout << " | " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:2" << endl;
cout << Answer << endl;
}

else if (y==7)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | /|\\ " << endl;
cout << " | / " << endl;
cout << " | " << endl;
cout << " ========= " << endl;
y++;
cout << "Chances Left:1" << endl;
cout << Answer << endl;
}

else if (y==8)
{
cout << " +-----+ " << endl;
cout << " | | " << endl;
cout << " | o " << endl;
cout << " | /|\\ " << endl;
cout << " | / \\ " << endl;
cout << " |GameOver " << endl;
cout << " ========= " << endl;
cout << Answer << endl;
y++;
}

}


}

cout << "Do You Want To Play Again?" << endl;
cout << "Press 1 for YES" << endl;
cout << "Press 2 for NO" << endl;
cin >> a;

if (a==1)
main();

else if (a==2)
cout << "Thanks for playing" << endl;




}


}


Crappy program as the game is only played with one word... So yeah.. You decide whether it's hard or not... Sorry if the coding doesn't work out.. Clash with HTML codes..

Thursday, April 10, 2008 [DeathTeaM]†BlaNc† Sprayed.
My wall, my rule.
You don't like my blog, Get lost. You hate me, don't bother to come in. F*ck off my blog if you're a hater. Playa's are welcome.

Twitter


The Owner Of The Wall
The blog is back ON! Not really frequent updates, but you will find updates every week.