1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 17:08:06 +11:00
collapseos/blk/126

17 lines
649 B
Plaintext
Raw Normal View History

2020-06-05 00:39:59 +10:00
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 ;
: large? COLS 67 > ; : col- 67 COLS MIN -^ ;
: acc@ ACC @ 1 MAX ;
2020-10-29 11:29:28 +11:00
: num ACC @ SWAP _pdacc IF ACC ! ELSE DROP THEN ;
2020-06-05 00:39:59 +10:00
: 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 ;
: mode! ( c -- ) 4 col- 0 AT-XY ;