Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void endResult(pin[,] wholeboard)
- {
- int count = 0;
- for (int i = 0; i < 7; i++)
- {
- for (int j = 0; j < 7; j++)
- {
- if (wholeboard[i, j].value == 1)
- {
- count++;
- }
- }
- }
- if (count == 1)
- {
- if (wholeboard[3,3].value == 2)
- {
- Console.WriteLine("You Win Perfectly.");
- }
- else
- {
- Console.WriteLine("You Win.");
- }
- }
- }
- static void losing(pin[,] wholeboard)
- {
- int noOfMoves = 0;
- foreach (pin aPin in wholeboard)
- {
- if (canMoveLeft(aPin, wholeboard))
- {
- noOfMoves++;
- }
- if (canMoveUp(aPin, wholeboard))
- {
- noOfMoves++;
- }
- if (canMoveRight(aPin, wholeboard))
- {
- noOfMoves++;
- }
- if (canMoveDown(aPin, wholeboard))
- {
- noOfMoves++;
- }
- }
- if (noOfMoves == 0)
- {
- Console.WriteLine("You Lose.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement