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;
- namespace ConsoleApplication1
- {
- class Program
- {
- enum targyak
- {
- ko,
- papir,
- ollo
- }
- static void Main(string[] args)
- {
- int tipp1, tipp2;
- int[] szamok = new int[3];
- Random vel = new Random();
- szamok[0] = (int)targyak.ko + 1;
- szamok[1] = (int)targyak.papir + 1;
- szamok[2] = (int)targyak.ollo + 1;
- do
- {
- Console.WriteLine("Jelmagyarázat: {0} - kő, {1} - papír, {2} - olló", szamok[0], szamok[1], szamok[2]);
- Console.Write("Első játékos tippje: 1-3-ig: ");
- tipp1 = Convert.ToInt32(Console.ReadLine());
- tipp2 = szamok[vel.Next(0, 3)];
- Console.Write("Második játékos tippje: 1-3-ig: {0} \n", tipp2);
- } while (tipp1 == tipp2);
- if ((tipp1 == szamok[2] && tipp2 == szamok[1]) || (tipp1 == szamok[1] && tipp2 == szamok[0]) || (tipp1 == szamok[0] && tipp2 == szamok[2]))
- {
- Console.WriteLine("Az első játékos nyert.");
- }
- else if ((tipp1 == szamok[2] && tipp2 == szamok[0]) || (tipp1 == szamok[1] && tipp2 == szamok[2]) || (tipp1 == szamok[0] && tipp2 == szamok[1]))
- {
- Console.WriteLine("A második játékos nyert.");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement