C++ on devc++ hangman game problem

[HELOO!!!
I AM WRITING A CODE FOR A HANG MAN GAME AS MY FINAL PROJECT *i am new to c++ as its my 1st semester
the code has a problem i want that if user inputs a key more than once it tells the user that you have entered the key befor...instead of that my code read the repeated number as a right number :/
NEED HELP!!!!!
*it was a long code but i have added a portion of it but it runs well *
plzz help if some one can :)







#include<iostream>
#include<ctime>
#include<windows.h>
#include<iomanip>
using namespace std;
int main()
{ int right=0;
int count=0;
int wrong=5;
char entry;
char arraydash[8]={'*','*','*','*','*','*','*','*'};
char arraypuzzle[8]={'P','A','K','I','S','T','A','N'};



cout<<"YOU HAVE TO GUESS A WORLD\nENTER SINGLE ALPHABET AT A TIME WITH
CAPS ON \n YOU WILL HAVE 5 CHANCES IF YOU ENTER A WRONG WORD\nEACH (*) REPRESENT A ALPHABET \n";
Sleep(3000);
system("pause");


cout<<endl;
//1
do
{

cout<<"#1.\n*hint name of a country\n";

for (int i=0;i<8;i++)
{
cout<<arraydash[i];
}
cout<<"\nENTER THE ALPHABET :";
cin>>entry;
for (int i=0;i<8;i++)
{
if (entry==arraypuzzle[i])
{ right++;
count++;
arraydash[i]=entry;
}
}
if(count>0)
{
cout<<"You have guessed it right \n";

for (int i=0;i<8;i++)
{
cout<<arraydash[i];
}
cout<<endl;
count=0;
cout<<endl;
}
else
{
cout<<"TRY AGAIN\n";
cout<<"YOU HAVE "<<wrong--<<" tries left\n";
}

}
while((wrong>-1)&&(right<8));
if(wrong>-1)
{
cout<<"\nYOU WON\n";
}
else
{
cout<<"BETTER LUCK NEXT TIME THE WORD WAS \n";
for(int i=0;i<8;i++)
{
cout<<arraypuzzle[i];
}
}
wrong=5;
right=0;
cout<<endl;
cout<<endl;
system("pause");

}]
Last edited on
duplicate thread here with responses

http://www.cplusplus.com/forum/general/152603/
thanks mate
Don't cross post. 1 Thread only.
yep got it
Topic archived. No new replies allowed.