I went with what I know and can use well, not what I know and can't figure the syntax out to make it look good.So please enjoy the code and prepare to school me (probably in the basics) in C#public static void Main (string[] args){    /* Here are your rules:     Scissors cuts paper,     paper covers rock,     rock crushes lizard,     lizard poisons Spock,     Spock smashes scissors,     scissors decapitate lizard,     lizard eats paper,     paper disproves Spock,     Spock vaporizes rock.     And as it always has, rock crushes scissors.     -- Dr. Sheldon Cooper */    List<string> listOfGestures = new List<string>();    listOfGestures.Add(rock);    listOfGestures.Add (paper);    listOfGestures.Add (scissors);    listOfGestures.Add (lizard);    listOfGestures.Add (spock);    int win = 0;    int lose = 0;    int tie = 0;    var newGame = true;    while (newGame)    {        var playerGesture = ;        var validInput = false;        while (!validInput)        {            var playerChoice = -1;            Console.WriteLine(Please choose your Gesture );            gameSetup(listOfGestures);            try            {                playerChoice = Convert.ToInt32 (Console.ReadLine());            }            catch (FormatException e)            {                validInput = false;            }            if (playerChoice > 0 && playerChoice <= listOfGestures.Count)            {                playerGesture = listOfGestures[playerChoice - 1];                validInput = true;            }            else            {                validInput = false;            }        }        var computerPlay = ComputerGesture(listOfGestures);        Console.WriteLine (Computer:  + computerPlay);        Console.WriteLine (your Gesture:  + playerGesture);        if (playerGesture == computerPlay)        {            tie++;            Console.WriteLine (you have tied with the computer);            Console.WriteLine (Computer:  + computerPlay);            Console.WriteLine (your Gesture:  + playerGesture);        }        else        {            if (playerGesture == rock)            {                if (computerPlay == lizard || computerPlay == scissors)                {                    Console.WriteLine (You Win,  + playerGesture +  Crushes  + computerPlay);                    win++;                }                else if (computerPlay == paper)                {                    Console.WriteLine (You Lose, Paper Covers Rock);                    lose++;                }                else if (computerPlay == spock)                {                    Console.WriteLine (You Lose, Spock Vaporizes Rock);                    lose++;                }            }             else if (playerGesture == paper)            {                if (computerPlay == spock)                {                    Console.WriteLine (You Win, Paper Disproves Spock);                    win++;                }                 else if (computerPlay == rock)                {                    Console.WriteLine (You Win, Paper Covers Rock);                    win++;                }                else if (computerPlay == lizard)                {                    Console.WriteLine (You Lose, Lizard Eats Paper);                    lose++;                }                else if (computerPlay == scissors)                {                    Console.WriteLine (You Lose, Scissors Cut Paper);                    lose++;                }            }            else if (playerGesture == scissors)            {                if (computerPlay == paper)                {                    Console.WriteLine (You Win, Scissors Cut Paper);                    win++;                }                else if (computerPlay == lizard)                {                    Console.WriteLine (You Win, Scissors Decapitate Lizard);                    win++;                }                else if (computerPlay == rock)                {                    Console.WriteLine (You Lose, Rock Crushes Scissors);                    lose++;                }                else if (computerPlay == spock)                {                    Console.WriteLine (You Lose, Spock Smashes Scissors);                    lose++;                }            }            else if ( playerGesture == lizard)            {                if (computerPlay == paper)                {                    Console.WriteLine (You Win, Lizard Eats Paper);                    win++;                }                else if (computerPlay == spock)                {                    Console.WriteLine (You Win, Lizard Poisons Spock);                    win++;                }                else if (computerPlay == scissors)                {                    Console.WriteLine (You Lose, Scissors Decapitates Lizard);                    lose++;                }                else if (computerPlay == rock)                {                    Console.WriteLine (You Lose, Rock Crushes Lizard);                    lose++;                }            }            else if (playerGesture == spock)            {                if (computerPlay == rock)                {                    Console.WriteLine(You Win, Spock Vaporizes Rock);                    win++;                }                else if (computerPlay == scissors)                {                    Console.WriteLine (You Win, Spock Smashes Scissors);                    win++;                }                else if (computerPlay == paper)                {                    Console.WriteLine (You Lose, Paper Disproves Spock);                    lose++;                }                else if (computerPlay == lizard)                {                    Console.WriteLine(You Lose, Lizard Poisons Spock);                    lose++;                }            }        }        Console.WriteLine (Your Score is (W:L:T:) : {0}:{1}:{2}, win, lose, tie);        Console.WriteLine (Again? Type 'n' to leave game.);        if (Convert.ToString (Console.ReadLine ().ToLower ()) == n)        {            Console.WriteLine (would you like to reset your Score?);            if (Convert.ToString (Console.ReadLine ().ToLower ()) == y)            {                win = 0;                lose = 0;                tie = 0;            }            Console.WriteLine (would you like to play another game?);            Console.WriteLine (if you type 'n' the game will end.);            if (Convert.ToString(Console.ReadLine().ToLower()) == n)            {                newGame = false;            }        }    }    Console.WriteLine(Goodbye);    Console.ReadLine ();}Helper Methods that I used.  I could probably use a couple more.public static void gameSetup (List<string> List){    for (int i=0; i<List.Count; i++) {        Console.WriteLine ((i+1) + :  + List[i]);    }       }With Random here I am not sure that I am using it correctly or if Random should be a static variable in the class scope and I should just be calling rand.next() everytime that I need to use it.public static string ComputerGesture (List<string> options){    Random rand = new Random();    return options[rand.Next(0,options.Count)];}
RPSLS Game in C#
c#;beginner;game;community challenge;rock paper scissors
Some minor syntax detail: C# has collection initializers so one can write:List<string> listOfGestures = new List<string> {    rock, paper, scissors, lizard, spock }You use magic strings for the gestures all over the place. This can pose a problem if you want to change them. You could do a find and replace but this could inadvertently change a part of a method or variable name which happens to include rock if you are not careful. In other solutions to the problem posted before enums were used instead. If you insist on using strings then make them named constants and use those insteadconst string Rock = rock;const string Paper = paper;... etc.The main problem is that the entire implementation is basically just one big blob of code in the main method. Logic and input/output are totally intertwined. Assume you have to write an automated test case for this - it will drive you insane. If I were to encounter code like this in production I would very likely kill it and rewrite it - the problem is fairly simple and given it's untestable there aren't any unit tests anyway. If the code were too much to rewrite then I'd start refactoring it. Possible steps:Create a Game class which effectively encapsulates the main while loop up until the line Console.WriteLine (Your Score is (W:L:T:) : {0}:{1}:{2}, win, lose, tie);Dump everything into one method into that class for starters.The Game class should also keep track of the score.Override ToString to print out the current scores.Move the ask user if he wants to play another round into a method on the Game classAfter that the Main should look somewhat like this:var game = new Game();var continuePlaying = true;while (continuePlaying){    game.Play();    Console.WriteLine(game.ToString());    continuePlaying = game.ShouldContinue();}Next step would be to start refactoring the Game class and the methods within.Move the decision logic into it's own internal private method to reduce the bulk of the Play() method.Define an interface for getting user input and another one for writing output. Pass these interfaces into the Game constructor. Provide a console implementation for both interfaces. Change all the input and output to use the interfaces rather than the console.Now Game is decoupled from the specific input and output methods and you can start writing unit tests for the Play() and the ShouldContinue() methods. Once you have done that you can continue refactoring those methods. And because you have just created unit tests you should be able to detect if you create any regressions (introducing bugs) while doing so.Wash, Rinse, Repeat