Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int CountMinesLeft(string[,] board, string[,] visibilityArray, int count)
- {
- if (visibilityArray.Length == 81)
- {
- count = 10;
- }
- else if (visibilityArray.Length == 256)
- {
- count = 40;
- }
- else if (visibilityArray.Length == 480)
- {
- count = 99;
- }
- for (int i = 0; i < board.GetLength(0); i++)
- {
- for (int p = 0; p < board.GetLength(1); p++)
- {
- if (visibilityArray[i, p] == "2")
- {
- count--;
- }
- }
- }
- return count;
- }
- static int CountMinesLeft(string[,] board, string[,] visibilityArray, ref int anotherCount)
- {
- if (visibilityArray.Length == 81)
- {
- anotherCount = 10;
- }
- else if (visibilityArray.Length == 256)
- {
- anotherCount = 40;
- }
- else if (visibilityArray.Length == 480)
- {
- anotherCount = 99;
- }
- int count = anotherCount;
- for (int i = 0; i < board.GetLength(0); i++)
- {
- for (int p = 0; p < board.GetLength(1); p++)
- {
- if (visibilityArray[i, p] == "2")
- {
- count--;
- }
- }
- }
- return count;
- int anotherCount = 0;
- int count = CountMinesLeft(board, visibilityArray, ref anotherCount);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement