Skip to content

Commit

Permalink
#2: Számítógép választ
Browse files Browse the repository at this point in the history
  • Loading branch information
PAULTR71 committed Mar 6, 2019
1 parent 447861a commit 45cdc4c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions kpo/kpo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ static void Main(string[] args)
///Megoldandó feladat 1:
///Ciklikus programfutás, amig a felhasználó szeretne játszani
bool moreGame = true;


Random r = new Random();

///Feladat 2: Változók létrehozása

string compChoice = "";
string playerChoice = "";

Expand Down Expand Up @@ -56,7 +56,18 @@ static void Main(string[] args)
///Feladat 4:
///Számítógép választásának kérdése: Random()
///

switch (r.Next(0, 3))
{
case 0:
compChoice = "kő";
break;
case 1:
compChoice = "papir";
break;
case 2:
compChoice = "olló";
break;
}


Console.Write("Akarsz még játszani? i/n");
Expand Down

0 comments on commit 45cdc4c

Please sign in to comment.