Skip to content
Snippets Groups Projects
Commit 8ce9f401 authored by DamianKomdeur's avatar DamianKomdeur
Browse files

Fixed hint bug

Fixed a bug where the program crashed when you click hint when the board is already filled in
parent 9d1c6ba0
No related branches found
No related tags found
No related merge requests found
......@@ -105,8 +105,20 @@ namespace PuzzlePlayer_Namespace
{
int row;
int col;
bool hintPossible = false;
while (true)
for (int i = 0; i < boardLength; i++)
{
for (int j = 0; j < boardLength; j++)
{
if (boardState[i, j] == emptySpace)
{
hintPossible = true;
}
}
}
while (hintPossible)
{
row = RandomNumber(boardLength) - 1;
col = RandomNumber(boardLength) - 1;
......
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