WSE2

WSE2
using System;

Console.WriteLine("Provide sign (rock/paper/scissors)");
string firstPlayerSign = Console.ReadLine();

Console.WriteLine("provide sign 2nd player");
string secondPlayerSign = Console.ReadLine();

if (firstPlayerSign == secondPlayerSign)
{
    Console.WriteLine("It's a draw");
}
else if ((firstPlayerSign == "rock" && secondPlayerSign == "scissors") 
         || (firstPlayerSign == "paper" && secondPlayerSign == "rock") 
         ||  (firstPlayerSign == "scissors" && secondPlayerSign == "paper"))
{
    Console.WriteLine("First player won");
}
else
{
    Console.WriteLine("Second player won");
}

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *

Akceptuję zasady Polityki prywatności