Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. static void endResult(pin[,] wholeboard)
  2. {
  3. int count = 0;
  4. for (int i = 0; i < 7; i++)
  5. {
  6. for (int j = 0; j < 7; j++)
  7. {
  8. if (wholeboard[i, j].value == 1)
  9. {
  10. count++;
  11. }
  12. }
  13. }
  14. if (count == 1)
  15. {
  16. if (wholeboard[3,3].value == 2)
  17. {
  18. Console.WriteLine("You Win Perfectly.");
  19. }
  20. else
  21. {
  22. Console.WriteLine("You Win.");
  23. }
  24. }
  25. }
  26. static void losing(pin[,] wholeboard)
  27. {
  28. int noOfMoves = 0;
  29. foreach (pin aPin in wholeboard)
  30. {
  31. if (canMoveLeft(aPin, wholeboard))
  32. {
  33. noOfMoves++;
  34. }
  35. if (canMoveUp(aPin, wholeboard))
  36. {
  37. noOfMoves++;
  38. }
  39. if (canMoveRight(aPin, wholeboard))
  40. {
  41. noOfMoves++;
  42. }
  43. if (canMoveDown(aPin, wholeboard))
  44. {
  45. noOfMoves++;
  46. }
  47. }
  48. if (noOfMoves == 0)
  49. {
  50. Console.WriteLine("You Lose.");
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement