@BilalMuakkit/

FaithfulGrownDecagon

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <iostream>
#include <unistd.h>
#include <ctime>
#include <cstdlib>

using namespace std;

int main() 
{
cout << "Welcome to the Price is Right Showdown Wheel!" << endl;
sleep(2);
cout << "Your opponent is spinning..." << endl;
sleep(2);
//code random event
srand((int) time(0));
int computer_spin = (rand() % 3) + 1;
int player_spin = (rand() % 3) + 1;
//create computer spin
switch(computer_spin)
{
case 1:
computer_spin = 5;
break;
case 2:
computer_spin = 10;
break;
case 3:
computer_spin = 15;
break;
}
cout << "Your opponent spun " << computer_spin << "." << endl;
sleep(2);
cout << "You are spinning..." << endl;
sleep(2);
//create player spin
switch(player_spin)
{
case 1:
player_spin = 5;
break;
case 2: 
player_spin = 10;
break;
case 3:
player_spin = 15;
break;
case 4:
player_spin = 20;
break;
case 5: 
player_spin = 25;
break;
case 6:
player_spin = 30;
break;
case 7:
player_spin = 35;
break;
case 8: 
player_spin = 40;
break;
case 9 :
player_spin = 45;
break;
case 10:
player_spin = 50;
break;
case 20: 
player_spin = 55;
break;
case 21:
player_spin = 60;
break;
case 22:
player_spin = 65;
break;
case 23: 
player_spin = 70;
break;
case 24:
player_spin = 75;
break;
case 25:
player_spin = 80;
break;
case 26: 
player_spin = 85;
break;
case 27 :
player_spin = 90;
break;
case 28: 
player_spin = 95;
break;
case 29 :
player_spin = 100;
break;

}
cout << "You spun " << player_spin << "." << endl;
}