diff --git a/PuzzlePlayer/Binary.cs b/PuzzlePlayer/Binary.cs index b0b50f788492e46b495580f717122c0400e60877..9c999001bc244218c24f73e84ce7b71297c358e4 100644 --- a/PuzzlePlayer/Binary.cs +++ b/PuzzlePlayer/Binary.cs @@ -102,7 +102,56 @@ namespace PuzzlePlayer_Namespace protected override List<int[,]> GetSolveList(int[,] boardToSolve) { - throw new NotImplementedException(); + List<int[,]> result = new List<int[,]>(); + + for (int i = 0; i < boardToSolve.GetLength(0); i++) + for (int j = 0; j < boardToSolve.GetLength(1); + { + int[,] move = CheckMove(i, j, boardToSolve); + if (move != null) + result.Add(move); + } + + + + return result; + } + + private int[,] CheckMove(int x, int y, int[,] boardToSolve) + { + bool validForZero = false; + bool validForOne = false; + + // empty check + if (boardToSolve[x, y] != emptySpace) + return null; + + // loop two times for checking 0 and 1 + for (int i = 0; i <= 1; i++) + { + // middle check + MiddleCheck(x, y, boardToSolve, i); + + // side check + + // even 1 and 0 in one row and colum + + + } + + + } + + // check if the space is surrounded on both sides by the same number. If it is, the checked space should be the opposite number + private bool MiddleCheck(int x, int y, int[,] b, int checkFor) + { + + if (b[x - 1, y]) + + return false; } + + } +} } } \ No newline at end of file