Я знаю, что этот вопрос был опубликован раньше, я в настоящее время использую код, который мне был дан, но после добавления некоторых вещей у меня возникли проблемы с получением его на самом деле Я хочу.Проблемы с моим камнем, бумажными ножницами
Это то, что приходит на моей консоли
- Вы хотите, чтобы играть рок, бумагу и ножницы?
- Да
- Вы должны выбрать между каменной бумагой и ножницами!
- рок
- выходит из программы
Что я делаю это не вызывает программу, чтобы перейти в игру?
using System;
class rockpsV2
{
public static void Main(string[]args)
{
do
{
Console.WriteLine("Do you want to play rock,paper or scissors?");
string userChoice = Console.ReadLine();
Random r = new Random();
int computerChoice = r.Next(4);
if (computerChoice == 1)
{
if (userChoice == "rock")
{
Console.WriteLine("The computer chose rock");
Console.WriteLine("It is a tie ");
}
else if (userChoice == "paper")
{
Console.WriteLine("The computer chose paper");
Console.WriteLine("It is a tie ");
}
else if (userChoice == "scissors")
{
Console.WriteLine("The computer chose scissors");
Console.WriteLine("It is a tie ");
}
else
{
Console.WriteLine("You must choose rock,paper or scissors!");
}
}
else if (computerChoice == 2)
{
if (userChoice == "rock")
{
Console.WriteLine("The computer chose paper");
Console.WriteLine("Sorry you lose,paper beat rock");
}
else if (userChoice == "paper")
{
Console.WriteLine("The computer chose scissors");
Console.WriteLine("Sorry you lose,scissors beat paper ");
}
else if (userChoice == "scissors")
{
Console.WriteLine("The computer chose rock");
Console.WriteLine("Sorry you lose,rock beats scissors");
}
else
{
Console.WriteLine("You must choose rock,paper or scissors!");
}
}
else if (computerChoice == 3)
{
if (userChoice == "rock")
{
Console.WriteLine("The computer chose scissors");
Console.WriteLine("You win,rock beats scissors");
}
else if (userChoice == "paper")
{
Console.WriteLine("The computer chose rock");
Console.WriteLine("You win,paper beats rock");
}
else if (userChoice == "scissors")
{
Console.WriteLine("The computer chose paper");
Console.WriteLine("You win,scissors beat paper");
}
else
{
Console.WriteLine("You must choose rock,paper or scissors!");
}
}
} while(Console.ReadLine() == "yes");
}
}
Пожалуйста, постарайтесь предоставить меньший пример/описать вашу проблему более точно ДЕТАЛЬ – torkleyy