15 puzzle game: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 5,775:
=={{header|FutureBasic}}==
<syntaxhighlight lang="
//
begin globals
Line 5,785:
void local fn buildUI
Long i, j, k = 1 // k is button number
window 1, @"
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
|