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 Game
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Rock, Paper, Scissors - the game");
- Console.WriteLine("1 - Rock");
- Console.WriteLine("2 - Paper");
- Console.WriteLine("3 - Scissors");
- Console.WriteLine("Player 1: ");
- int a = int.Parse(Console.ReadLine());
- //Console.WriteLine("Player 2");
- //int b = int.Parse(Console.ReadLine()); //Ввод игрока
- Random rand = new Random();
- int b = rand.Next(1, 4); //Рандомный ввод
- Console.WriteLine("Player 2: ");
- Console.WriteLine(b);
- if (a == b)
- {
- Console.WriteLine("Friendship wins");
- }
- else if (a == 1 && b == 3 || a == 2 && b == 1 || a == 3 && b == 2)
- {
- Console.WriteLine("Player 1 win");
- }
- else
- {
- Console.WriteLine("Player 2 win");
- }
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement