Sign in to follow this  

Rock paper scisor program

This topic is 3941 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i can't get rock paper scissor program to run somebody please help me. /* TomkeyBAngura march 5, 2007 Cs 161 section 2 */ #inclulde <iostream> using namespace std; int main() { char player1; char player2; char response; while( (response!='n'))&&(reponse!='N')) { if (player1==n'p')&& (player 2=='p')) { cout<<"you tied!!"<<endl; } cout<<"please enter p for paper, s for scissors and R for rock "<<endl; cin>>player 1; cout<<"player 2 please enter p for paper, s for scissors and R rock"<<endl; cin>>player 2; cout<<"do you want to play again"<<endl; cin>>response; } system("pause") return 0: }

Share this post


Link to post
Share on other sites
They're mostly spelling errors ('#inclulde'). Variable names can't have spaces in them by the way, so check that, there are a few places you have done this ('player 1' for example). Generally, just go through and check the names are consistent with what you called them when you initially declared them.


You also have missed a semi-colon after the 'system' call, a colon rather than a semi-colon after the 'return' call, and have various brackets that dont match up (the while and if statements).

These are all pretty minor mistakes that your compiler will flag up, so pay attention to the error's that are generated next time. These are just the syntax, as far as the program working, for starters, you haven't initialised the variables before using them in the while loop, so they will contain junk values.

Good luck.

Share this post


Link to post
Share on other sites
Sign in to follow this