Format

I need to make the path look like this.

"Which slot do you want to drop the chip in (0-8)? 4

*** DROPPING CHIP INTO SLOT 4 ***
PATH: [4.0 4.5 4.0 4.5 5.0 4.5 5.0 4.5 5.0 5.5 5.0 5.5 5.0]
WINNINGS: $0.00"

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
if (option == "1")
		{
			cout << "Which slot do you want to drop the chip in (0-8)?: ";
			cin >> slotnumber;

			if (slotnumber >= 0 && slotnumber <= 8)
			{
				double location = slotnumber;
				cout << location << endl;
				for (int i = 0; i < 12; i++)
				{
					double random = rand() % 2;
					if (random < 1)
					{
						location = location + 0.5;
					}
					else
					{
						location = location - 0.5;
					}
					if (location < 0)
					{
						location = 0.5;
					}
					else if (location > 8)
					{
						location = 7.5;
					}
					cout <<location<< endl;
				}

				if (location == 0) { reward = PRIZE_0; }
				else if (location == 1) { reward = PRIZE_1; }
				else if (location == 2) { reward = PRIZE_2; }
				else if (location == 3) { reward = PRIZE_3; }
				else if (location == 4) { reward = PRIZE_4; }
				else if (location == 5) { reward = PRIZE_5; }
				else if (location == 6) { reward = PRIZE_6; }
				else if (location == 7) { reward = PRIZE_7; }
				else if (location == 8) { reward = PRIZE_8; }

			}

			cout << "Winnings: " << reward <<endl;
	
Topic archived. No new replies allowed.