Why wont this run?

Hi all, im trying to get this here program to build, but for some reason, it refuses to do so.

Now, I keep getting this message saying that my bottom bracket (Line 52) is expecting "while" but I already have a bracket closing off "while" portion of the code.

Can someone take a quick look and tell me whats going wrong with this?

Thanks in advance

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream> 
#include <stdlib.h> 
using namespace std;

int main(){

	int comp_move, move;
	char choice;

	do{
		comp_move = rand()%3 + 1;

		cout << "Would you like to play Rock, Paper, Scissors? Press 'y' for yes and 'n' for no." << endl;
		cin >> choice;

		if (choice == 'y'){

			cout << "Press 1 for rock, 2 for paper, 3 for scissors.";
			cin >> move;

			if (comp_move == move) {
				cout << "Tie!";
			}
			if (move == 1 && comp_move == 2){
				cout << "Paper! You lose";
			}
			if (move == 2 && comp_move == 3){
				cout << "Scissors! You lose";
			}
			if (move == 3 && comp_move == 1){
				cout << " Rock! You lose";
			}
			else{
				cout << "You win!";
			}
			
		}
	
	while(choice !='n'){
	cout << "Press any key then enter. Goodbye!";
	cin >> choice;
	}

	return 0;
	}
}
Couple little problems here:
1. You need to close the 'do' statements, which is currently left open, and the statements after the while in brackets are... well pointless? No, but you don't need the brackets, because you aren't starting another while loop using those. So remove those brackets and add one before the while and it should run fine.
Yep! didnt realize that the "while" section was still technically in the "do" block.
Also got rid of those brackets you were talking about.

Thanks a bunch Trtrin
Topic archived. No new replies allowed.