Here are screenshots of my current code.
The first image shows my code for the function that checks if each square is correct. This is attached to the event tick.
The second is attached to the button press for the hint. Each square in each puzzle that has a hint has a similar set up in this function.
A random number is generated at the start of each puzzle (on the begin play node), and assigned to the HintNum variable. (Note, is normally set to search between 0 and last index, but I have it set to 0 to 1 for testing).
In the hint code, it first finds which integer is set in the “HintNum” variable. For the sake of explanation, we will just say it is 0. The code then finds which puzzle is currently on screen, and gets the “tags” I have assigned for the solution, and compares it to the corresponding tag in a local array (which are filled in as the user plays the game. I.e. they click the color black on a square that should be black, the local tag is set to black). All tags at the start of the puzzle are defaulted to read “NULL.” So, if square 10 is supposed to be black, but is NULL, then the first two array elements are not equal. Thus if HintNum is 0 and the two tags are not equal, then they are filled in with the correct color/tag (black). This is what is happening on that second part of the code. If, however, the two tags ARE equal it will generate a new random integer, and repeat the process until it finds an incorrect square. At least, that is how it is supposed to work. It does not.
If you need further explanation, let me know.