-
Notifications
You must be signed in to change notification settings - Fork 7
/
sharpmaz.cmd
54 lines (49 loc) · 1010 Bytes
/
sharpmaz.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## sharpmaz.cmd -- redraw a block maze using line characters
execute-file maze.cmd
set %meml $curline
set %memc $curcol
end-of-line
set %ec &sub $curcol 1
end-of-file
set %el &sub $curline 1
previous-line
set %spaces $line
beginning-of-file
set %old $line
set $line %spaces
next-line
!while &less $curline %el
set $curcol 1
!while &less $curcol %ec
!if ¬ &equ $curchar 32
set %v 0
set %inc 1
previous-line
!gosub check
next-line
backward-character
!gosub check
2 forward-character
!gosub check
next-line
backward-character
!gosub check
previous-line
# alternatively use single width "╳╵╴┘╶└─┴╷│┐┤┌├┬┼"
set $curchar &asc &mid "╳╹╸┛╺┗━┻╻┃┓┫┏┣┳╋" &add %v 1 1
!endif
forward-character
!endwhile
next-line
!endwhile
beginning-of-file
set $line %old
set $curline %meml
set $curcol %memc
!return
:check
!if ¬ &equ $curchar 32
set %v &add %v %inc
!endif
set %inc &tim %inc 2
!return