And this is the subroutine I write to put on big display characters on screen. Too bad I can't fit it in into one screen.
I trust you know what line to change in upper screen in order to have this, by now. ;)
The comment in your code asked if we could do it in 600 bytes. Here's my go at it. Excluding the comment, it's 573 bytes.
After launching the game, press a button to scramble the tiles. Use the direction buttons to slide tiles, or press B to exit. The game will detect when the solution is found. After that, press a button to exit.
Excellent! A few observations:
RANDOMIZE 0 is not needed.
IF S will work fine. FALSE is 0. TRUE is non-zero. <>= operators are optional.
Try using BUTTON(N) where N is 0-3. Default is zero, but that leads to overflow. I regularly use BUTTON(3) to prevent overflow.
Excellent work! I appreciate it!
If I really want to save space, I'd use simple string. T$="0123456789ABCDE ", and index it T$[Y×4+X]. It's great that you check for winning condition. I can't do that because shuffling is optional, and the puzzle begins in solved state.
BTW, that 600 bytes limit is an early Apple Macintosh reference. :)
2nd post, the output.
It seem that if the destination of the assignment is not subjected to some operation that changes it, it remains a pointer to the original, vs a copy of it.
I found the official bug reporting topic. The fastest way to locate it is by its search for its author, MiiVerse user smile5884, then looking at his most recent discussion.