Skip to content
Snippets Groups Projects
Commit cc2184c8 authored by bionic85's avatar bionic85
Browse files

Update Binary.cs

parent dcd14b4e
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment