16 puzzle game: Difference between revisions
→{{header|FutureBasic}}
Line 192:
<syntaxhighlight lang="future basic">
begin enum
_new = 1▼
_restrt▼
_help▼
_end▼
_down = 1
_right
_up
_left
▲ _restrt
▲ _help
▲ _end
end enum
str63 board, startPos, winBoard
Line 245:
void local fn move( tag as int )
int
select tag / 10
case _left : rc*=4
Line 251:
case _right : rc*=4
mid$(board, rc-3, 4) = mid$(board, rc, 1) + mid$(board, rc - 3, 3)
case _up
for r = rc to 12 step 4
swap board[r]
next
case
for r = rc + 12 to 5 step -4
swap board[r]
next
end select
if board == winBoard then window 1, @"!!! YOU WON !!!" : text,,fn colorRed
Line 302 ⟶ 299:
void local fn doDialog(ev as long, tag as long)
select ev
case _btnClick : if tag
case _windowWillClose : end
end select
|