Hey, this game is cooler than dirt!
I am not sure what your requirements are -- are you supposed to make your program solve the puzzle? or are you just supposed to notice when the user has successfully solved the puzzle?
You have, BTW, a conflict in your data. Both '2' and the smiley are represented by '2'. Make the smiley an
invalid number.
Then, if all you have to do is check to see if the user has succeeded in sorting the array, just count through the array with a loop, checking to see that the current index is larger than the last, ignoring the invalid value (which is the smiley).
If you have to solve the puzzle let me know and I (or someone) will give you some hints.
Hope this helps.
Reputation Points: 1140
Solved Threads: 229
Postaholic
Offline 2,039 posts
since Oct 2007