uemacs/sharpmaz.cmd

55 lines
1010 B
Batchfile
Raw Normal View History

2021-09-01 01:40:34 +00:00
## sharpmaz.cmd -- redraw a block maze using line characters
execute-file maze.cmd
2021-09-01 01:40:34 +00:00
set %meml $curline
set %memc $curcol
end-of-line
set %ec &sub $curcol 1
end-of-file
set %el &sub $curline 1
2021-09-01 01:40:34 +00:00
previous-line
set %spaces $line
2021-09-01 01:40:34 +00:00
beginning-of-file
set %old $line
set $line %spaces
2021-09-01 01:40:34 +00:00
next-line
2021-09-01 01:40:34 +00:00
!while &less $curline %el
set $curcol 1
!while &less $curcol %ec
!if &not &equ $curchar 32
set %v 0
set %inc 1
2021-09-01 01:40:34 +00:00
previous-line
!gosub check
2021-09-01 01:40:34 +00:00
next-line
backward-character
!gosub check
2021-09-01 01:40:34 +00:00
2 forward-character
!gosub check
2021-09-01 01:40:34 +00:00
next-line
backward-character
!gosub check
2021-09-01 01:40:34 +00:00
previous-line
# alternatively use single width "╳╵╴┘╶└─┴╷│┐┤┌├┬┼"
set $curchar &asc &mid "╳╹╸┛╺┗━┻╻┃┓┫┏┣┳╋" &add %v 1 1
!endif
2021-09-01 01:40:34 +00:00
forward-character
!endwhile
2021-09-01 01:40:34 +00:00
next-line
!endwhile
2021-09-01 01:40:34 +00:00
beginning-of-file
set $line %old
2021-09-01 01:40:34 +00:00
set $curline %meml
set $curcol %memc
!return
:check
!if &not &equ $curchar 32
set %v &add %v %inc
!endif
set %inc &tim %inc 2
!return