15 puzzle game: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 5,775:
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futureBasicFutureBasic">
// 1615 Puzzle // 26 september 2023 //
 
begin globals
Line 5,785:
void local fn buildUI
Long i, j, k = 1 // k is button number
window 1, @"1615 Puzzle", ( 0, 0, 200, 200 ), 3
for j = 3 to 0 step -1 : for i = 0 to 3 // Top to bottom, left to right
button k, Yes, 1, @"", ( 20 + 40 * i, 20 + 40 * j , 40, 40 ), , NSBezelStyleShadowlessSquare
Line 5,825:
void local fn move ( n as Long )
CFStringRef s
Long i, m, x = -1 // x is empty plot
Bool ok
for i = 1 to 4 // see if clicked button is next to empty plot
m = n + int( 2.6 * i - 6.5 ) // -4. -1, +1, +4
ok = Yes
60

edits