static void Main(string[] args) { chocolateBar = new Gameboard(10, 10); robot = new Robot(); playerTurn = true; GameUpdate(); }
public void Play(Gameboard currentGameBoard) { chocolateBar = currentGameBoard; bool moved = false; int[] plays = { 0, 1, 2, 3 }; List <int> playOrder = plays.ToList(); Shuffle(playOrder); foreach (int item in playOrder) { switch (item) { case 1: moved = TryBreakTop(); break; case 2: moved = TryBreakBottom(); break; case 3: moved = TryBreakLeft(); break; case 4: moved = TryBreakRight(); break; } if (moved) { return; } } throw new Exception("Robot had an issue moving"); }