Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace casinor
- {
- class Program
- {
- static void Main(string[] args)
- {
- string user, name1, name2;
- int cash1, cash2, opcion, pass1, pass2;
- cash1 = 0;
- cash2 = 0;
- Console.WriteLine("welcome to casino Royale");
- Console.WriteLine("Please input your name, password and amount of money youll start with");
- //user 1 pass is 123 and user 2 pass is 321
- Console.Write("Write your name user 1: ");
- name1 = Console.ReadLine();
- Console.Write("password: ");
- pass1= int.Parse(Console.ReadLine());
- if (pass1== 123)
- {
- Console.WriteLine("Correct password");
- Console.Write("How much money are you willing to spend: ");
- cash1 = int.Parse(Console.ReadLine());
- }
- else
- {
- Console.Clear();
- Console.WriteLine("Wrong password please try again");
- }
- Console.Clear();
- Console.Write("Write tour name user 2: ");
- name2 = Console.ReadLine();
- Console.Write("Ingresa la clave: ");
- pass2= int.Parse(Console.ReadLine());
- if (pass2== 321)
- {
- Console.WriteLine("Correct Password");
- Console.Write("How much money are you willing to spend: ");
- cash2 = int.Parse(Console.ReadLine());
- }
- else
- {
- Console.Clear();
- Console.WriteLine("Wrong password please try again");
- }
- Console.Clear();
- string menu;
- menu = "y";
- do
- {
- Console.WriteLine("Elige una de las opciones del menu que deas desplegar");
- Console.WriteLine("1) Guess the number");
- Console.WriteLine("2) Blackjack");
- Console.WriteLine("3) Roulette");
- Console.WriteLine("4) VIP card");
- Console.WriteLine("5) Exchange center");
- Console.WriteLine("6) Exit");
- opcion = Convert.ToInt32(Console.ReadLine());
- while (opcion == 1)
- {
- Console.Clear();
- Console.WriteLine("GUESS THE NUMBER");
- string dec;
- int intot1 = 0, intot2 = 0;
- dec = "y";
- while (dec == "y")
- {
- Console.WriteLine("que usuario esta jugando?");
- user = Console.ReadLine();
- if (user == name1)
- {
- Console.Clear();
- Random random = new Random();
- int num01 = random.Next(1, 10);
- int num, intentos;
- Console.WriteLine("Guess a number between 1 and 10");
- num = int.Parse(Console.ReadLine());
- intentos = 1;
- while (num != num01)
- {
- if (num < num01)
- {
- intentos = intentos + 1;
- Console.WriteLine("Too low, Try again");
- num = int.Parse(Console.ReadLine());
- intot1 = intot1 + 1;
- }
- else if (num > num01)
- {
- intentos = intentos + 1;
- Console.WriteLine("Too high, Try again");
- num = int.Parse(Console.ReadLine());
- intot1 = intot1 + 1;
- }
- if (num == num01)
- {
- Console.WriteLine("Congratulations! you're right");
- }
- }
- if (intentos == 1 && num == num01)
- {
- Console.WriteLine("Congratulations! you're right");
- Console.WriteLine("you won 300 points");
- cash1 = cash1 + 300;
- }
- else if (intentos < 4 && intentos > 1 && num == num01)
- {
- Console.WriteLine("you won 100 points");
- cash1 = cash1 + 100;
- }
- else if (intentos == 4 || intentos == 5 && num == num01)
- {
- Console.WriteLine("you won 50 points");
- cash1 = cash1 + 50;
- }
- else if (intentos > 5)
- {
- Console.WriteLine("No points");
- cash1 = cash1 + 0;
- }
- }
- else if (user == name2)
- {
- Console.Clear();
- Random random = new Random();
- int num01 = random.Next(1, 10);
- int num, intentos;
- Console.WriteLine("Guess a number between 1 and 10");
- num = int.Parse(Console.ReadLine());
- intentos = 1;
- while (num != num01)
- {
- if (num < num01)
- {
- intentos = intentos + 1;
- Console.WriteLine("Too low, Try again");
- num = int.Parse(Console.ReadLine());
- intot2 = intot2 + 1;
- }
- else if (num > num01)
- {
- intentos = intentos + 1;
- Console.WriteLine("Too high, Try again");
- num = int.Parse(Console.ReadLine());
- intot2 = intot2 + 1;
- }
- if (num == num01)
- {
- Console.WriteLine("Congratulations! you're right");
- }
- }
- if (intentos == 1 && num == num01)
- {
- Console.WriteLine("Congratulations! you're right");
- Console.WriteLine("You won 300 points");
- cash2 = cash2 + 300;
- }
- else if (intentos < 4 && intentos > 1 && num == num01)
- {
- Console.WriteLine("You won 100 points");
- cash2 = cash2 + 100;
- }
- else if (intentos == 4 || intentos == 5 && num == num01)
- {
- Console.WriteLine("You won 50 points");
- cash2 = cash2 + 50;
- }
- else if (intentos > 5)
- {
- Console.WriteLine("No points");
- cash2 = cash2 + 0;
- }
- }
- else if (user != name1 && user != name2)
- {
- Console.WriteLine("Game Over! input a valid user");
- }
- Console.Write("play again? (y/n)?");
- dec = Console.ReadLine();
- //it just plays again even if i say no
- }
- Console.Clear();
- if (intot1 > intot2)
- {
- Console.WriteLine(name1 + " is the winner");
- }
- else if (intot2 > intot1)
- {
- Console.WriteLine(name2 + " is the winner");
- }
- }
- Console.WriteLine("return to menu? (y/n");
- menu = Console.ReadLine();
- } while (menu == "n");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement