Совершенно новый C# Coder Здесь я сделал простую игру «казино» (вероятно, с ужасным синтаксисом).
Я пытаюсь играть в этот сценарий снова и снова, отслеживая переменную «деньги» вместо сценария, просто заканчивающегося, когда играет одна игра. Есть советы? < /P>
// See https://aka.ms/new-console-template for more information
using System;
using Microsoft.VisualBasic;
Console.WriteLine(" ___ _ ");
Console.WriteLine(" / __|__ _ __(_)_ _ ___ ");
Console.WriteLine("| (__/ _` (_-< | ' |/ _ | ");
Console.WriteLine("|_______,_/__/_|_||_|___/");
Random rnd = new Random();
int money = 10; // starts the user with 10 dollars
int random = rnd.Next(1, 4); // choosing random ass number for the random variable
Console.WriteLine("Welcome");
Console.WriteLine("Please enter age");
string input1 = Console.ReadLine();
int ass = Int32.Parse(input1); // making "ass" equal to "input1"
if (ass >= 18)
{
Console.WriteLine("Please choose an integer 1-3 ");
string input2 = Console.ReadLine();
Console.WriteLine("You have " + money + " dollars."); // stating the current balance
Console.WriteLine("How much would you like to bet?");
string inputmoney = Console.ReadLine();
int bet = Int32.Parse(inputmoney); // making the string "input" equal to the int variable "shit"
Console.WriteLine("Spinning");
int shit = Int32.Parse(input2); // making the string "input" equal to the int variable "shit"
if (shit == random) // if the user's guess was correct
{
int sum = (bet * 3) + money; // generates user's current sum
Console.WriteLine("You Win!");
Console.WriteLine("Your current balance is " + sum); // displays user's current sum
Console.Write("The integer was " + shit);
}
else // if the user's guess was incorrect
{
int sum = money - bet; // generates user's current sum
Console.WriteLine("You Lose");
Console.WriteLine("Your current balance is " + sum); // displays user's current sum
Console.Write("The integer was " + random);
}
}
else
Console.WriteLine("Please come back when you are 18.");
Я пытался просто копировать и вставать на это снова и снова, но это грех против Бога
Совершенно новый C# Coder Здесь я сделал простую игру «казино» (вероятно, с ужасным синтаксисом). Я пытаюсь играть в этот сценарий снова и снова, отслеживая переменную «деньги» вместо сценария, просто заканчивающегося, когда играет одна игра. Есть советы? < /P> [code]// See https://aka.ms/new-console-template for more information using System; using Microsoft.VisualBasic;
Random rnd = new Random(); int money = 10; // starts the user with 10 dollars int random = rnd.Next(1, 4); // choosing random ass number for the random variable
Console.WriteLine("Welcome"); Console.WriteLine("Please enter age");
string input1 = Console.ReadLine(); int ass = Int32.Parse(input1); // making "ass" equal to "input1" if (ass >= 18) { Console.WriteLine("Please choose an integer 1-3 "); string input2 = Console.ReadLine();
Console.WriteLine("You have " + money + " dollars."); // stating the current balance Console.WriteLine("How much would you like to bet?");
string inputmoney = Console.ReadLine(); int bet = Int32.Parse(inputmoney); // making the string "input" equal to the int variable "shit"
Console.WriteLine("Spinning");
int shit = Int32.Parse(input2); // making the string "input" equal to the int variable "shit"
if (shit == random) // if the user's guess was correct { int sum = (bet * 3) + money; // generates user's current sum Console.WriteLine("You Win!"); Console.WriteLine("Your current balance is " + sum); // displays user's current sum Console.Write("The integer was " + shit); } else // if the user's guess was incorrect { int sum = money - bet; // generates user's current sum Console.WriteLine("You Lose"); Console.WriteLine("Your current balance is " + sum); // displays user's current sum Console.Write("The integer was " + random); } } else Console.WriteLine("Please come back when you are 18."); [/code] Я пытался просто копировать и вставать на это снова и снова, но это грех против Бога