1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-17 18:16:22 -05:00
uemacs/sharpmaz.cmd

55 lines
1010 B
Batchfile
Raw Normal View History

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