- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
Red [ needs: 'view ]
empty: 4x4
grid: random do [
res: copy[]
repeat i 15 [append res to string! i]
res
]
loop 15 [grid: next insert grid 't]
grid: head grid
loop 3 [grid: insert skip grid 8 'return]
grid: head insert [empty-cell: base 50x50 silver ] head grid
view head insert grid [
title "15 game"
backdrop silver
style t: button 50x50 [
tmp: face/offset
i: tmp/y / face/size/y + 1
j: tmp/x / face/size/x + 1
if (absolute empty/1 - i) + (absolute empty/2 - j) = 1 [
face/offset: empty-cell/offset
empty-cell/offset: tmp
empty: as-pair i j
]
]
across
]
HighVoltageCock 13.08.2018 22:06 # 0
guest8 15.08.2018 11:38 # −999