collapseos/blk/126
Virgil Dupras 10da104873 VE: decouple from core's LIST
I'm planning on de-hardcoding columns in VE a bit to add support
for screens narrower than 67 columns. There's a lot of hardcoding.

Let's begin with not using core's LIST anymore. This allows us to
spit 1-16 numbers only at startup.
2020-11-13 15:19:00 -05:00

15 lines
570 B
Plaintext

CREATE CMD 2 C, '$' C, 0 C,
CREATE PREVPOS 0 , CREATE PREVBLK 0 ,
: MIN ( n n - n ) 2DUP > IF SWAP THEN DROP ;
: MAX ( n n - n ) 2DUP < IF SWAP THEN DROP ;
: acc@ ACC @ 1 MAX ;
: num ACC @ SWAP _pdacc IF ACC ! ELSE DROP THEN ;
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
: aty 0 SWAP AT-XY ;
: clrscr LINES 0 DO I aty COLS nspcs LOOP ;
: gutter ( ln n ) OVER + SWAP DO 67 I AT-XY '|' EMIT LOOP ;
: status 0 aty ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC
BLKDTY @ IF '*' EMIT THEN 10 nspcs ;
: nums 17 1 DO 2 I + aty I . SPC SPC LOOP ;