Any and all help appreciated. Please and thank you. :)
Simply put, the won() function doesn't work correctly. It's giving a premature win signal. As written, all it needs to see is 1 in the first box to generate a win.
If you walk through the code of your won() function, you'd see that the inner loop will only ever execute once. If 1 is not in board, it will immediately return false. The problem is that if it is 1, the code will immediately return true, without checking any other elements.
In this scenario, true should ONLY be returned after all the elements have been checked. While checking, the code should simply continue looping if all the correct numbers are in the correct array elements, and should immediately stop if something is in the wrong place. It should NOT return true until the inner and outer loops complete.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)