[Help] So my University coursework is to create a non visual text based board game.

I have chosen snakes and ladders however I cannot get the code to work to get the turn to switch to player 1/2

This is my code:

 int IN_Player1 = 1; int IN_Player2 = 2; bool BL_PlayerTurns; BL_PlayerTurns = false; if (IN_PL1Location == 100) { Console.WriteLine("Player 1 Wins"); IN_PL1Location = Convert.ToInt32(Console.ReadLine()); } else if (IN_PL2Location == 100) { Console.WriteLine("Player 2 Wins"); IN_PL2Location = Convert.ToInt32(Console.ReadLine()); } while (BL_PlayerTurns == true); if (IN_PlayerTurns == 2) { Console.WriteLine("Player 2 Roll the dice"); Random DiceRolls = new Random(); int IN_Dice = DiceRolls.Next(1, 6); Console.Write("Player 2 got {0}", IN_Dice); IN_Player2 = IN_PL2Location + IN_Dice; CheckSpace(); IN_PlayerTurns = 1; Console.ReadLine(); } else { Console.WriteLine("Player 1 Roll the dice"); Random DiceRolls = new Random(); int IN_Dice = DiceRolls.Next(1, 6); Console.Write("Player 1 got {0}", IN_Dice); IN_Player1 = IN_PL1Location + IN_Dice; CheckSpace(); IN_PlayerTurns = 2; Console.ReadLine(); } } 

by HowToEatBurgers via /r/csharp

Leave a Reply