プレイ日記
ĦHarry Ramstrong
15 Puzzle. It's a little tile sliding game. It comes with auto shuffle.
7そうだね
プレイ済み
返信[1]
親投稿
ĦHarry Ramstrong
Not sure whether I should move the hole around or slide the tile in. But hey, the source code is provided. Feel free to modify. :)
1そうだね
プレイ済み
返信[2]
親投稿
ĦHarry Ramstrong
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. ;)
0そうだね
プレイ済み
返信[3]
親投稿
ĦHarry Ramstrong
And that's how it looks. Must resist playing... Resist... Resist... Oh, what the heck. Just 5 more minutes. ^_^;
0そうだね
プレイ済み
返信[4]
親投稿
OlOOlOOl pi_r_round
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.
1そうだね
プレイ済み
返信[5]
親投稿
ĦHarry Ramstrong
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!
0そうだね
プレイ済み
返信[6]
親投稿
ĦHarry Ramstrong
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. :)
0そうだね
プレイ済み
返信[7]
親投稿
ĦHarry Ramstrong
Something like this. And I seem to run into a bug!
0そうだね
プレイ済み
返信[8]
親投稿
OlOOlOOl pi_r_round
Oh. I'll see if I can reproduce the bug. If I recall correctly, SmileBoom had a Discussion topic here for collecting bug reports.
0そうだね
プレイ済み
返信[9]
親投稿
ĦHarry Ramstrong
I think it's Reference vs Copy technique. It should be Copy all the time.
0そうだね
プレイ済み
返信[10]
親投稿
OlOOlOOl pi_r_round
I agree. 1st post, the code.
0そうだね
プレイ済み
返信[11]
親投稿
OlOOlOOl pi_r_round
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.
0そうだね
プレイ済み
返信[12]
親投稿
OlOOlOOl pi_r_round
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.
1そうだね
プレイ済み
返信[13]
親投稿
OlOOlOOl pi_r_round
Oh. I see you found it already. Well, I hope they fix it.
1そうだね
プレイ済み
返信[14]
親投稿
OlOOlOOl pi_r_round
Thanks for the tip about RANDOMIZE. I got it down to 471 bytes.
1そうだね
プレイ済み
返信[15]
親投稿
ĦHarry Ramstrong
I just remembered that Strings are Arrays! You use the COPY command to copy string. I left an explanation on the bug page.
0そうだね
プレイ済み
返信[16]
親投稿
OlOOlOOl pi_r_round
Hmm... interesting. So, maybe it's not a bug; it's a feature?
1そうだね
プレイ済み