Skip to content

Commit

Permalink
#2: Játkos válasz bekérése
Browse files Browse the repository at this point in the history
  • Loading branch information
PAULTR71 committed Mar 6, 2019
1 parent aa296e4 commit eb84ba3
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions kpo/kpo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,40 @@ static void Main(string[] args)
///Megoldandó feladat 1:
///Ciklikus programfutás, amig a felhasználó szeretne játszani
bool moreGame = true;




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

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

int compScore = 0;
int playerScore = 0;


Console.WriteLine("*******Kő/Papir/Olló játék*********");

do
{
///Feladat 3:
///Player választásának megkérdezése és tárolása
///
Console.WriteLine("Mit választasz? k/p/o");

switch (Console.ReadKey(true).KeyChar)
{
case 'k':
playerChoice = "kő";
break;
case 'p':
playerChoice = "papir";
break;
case 'o':
playerChoice = "olló";
break;
}

Console.Write("Akarsz még játszani? i/n");
if (Console.ReadKey(true).KeyChar == 'n')
{
Expand All @@ -42,7 +62,7 @@ static void Main(string[] args)

} while (moreGame);





Expand Down

0 comments on commit eb84ba3

Please sign in to comment.