Repository navigation
Expand file tree
/
Copy pathroulette.cs
More file actions
54 lines (52 loc) · 1.79 KB
/
Copy pathroulette.cs
File metadata and controls
54 lines (52 loc) · 1.79 KB
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
using System;
class HelloWorld {
static void Main() {
int money = 1000;
Console.WriteLine("Welcome to Codelearn Roulette!!");
string win = "";
while(money > -1){
Console.Write("You have {0} €. How much money do you want to bet? ", money);
int bet = int.Parse(Console.ReadLine());
Console.WriteLine("You succsesfully bet {0} €", bet);
Console.Write("Do you want to bet to a number or color? (n/c) ");
string nc = Console.ReadLine();
if(nc == "n"){
Console.Write("What number do you want (0-36) ");
int number = int.Parse(Console.ReadLine());
while(number<0 || number>36){
Console.Write("Incorrect value. What number do you want? (0-36) ");
number = int.Parse(Console.ReadLine());
}
int winnumber = 0;
if(number==36){
winnumber = 35;
}
else{
winnumber = number+1;
}
win = winnumber.ToString();
}
if(nc == "c"){
Console.Write("What color do you want (b/r) ");
string color = Console.ReadLine();
while(color!="b" && color!="r"){
Console.Write("Incorrect value. What color do you want? (b/r) ");
color = Console.ReadLine();
}
if(color=="b"){
win = "red";
}
else{
win = "black";
}
}
for(int i=0; i<10000; i++){
Console.WriteLine("Spinning.");
Console.WriteLine("Spinning..");
Console.WriteLine("Spinning...");
}
Console.WriteLine("The output is: {0}. You just lost {1} €", win, bet);
money -= bet;
}
}
}