mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 15:08:05 +11:00
17 lines
717 B
Plaintext
17 lines
717 B
Plaintext
CREATE CMD 2 C, '$' C, 0 C,
|
|
CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 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 -^ ;
|
|
: width large? IF 64 ELSE COLS THEN ;
|
|
: acc@ ACC @ 1 MAX ; : pos@ ( x y -- ) EDPOS @ 64 /MOD ;
|
|
: 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 pos@ . ',' EMIT . xoff @ IF '>' EMIT THEN SPC
|
|
BLKDTY @ IF '*' EMIT THEN 4 nspcs ;
|
|
: nums 17 1 DO 2 I + aty I . SPC SPC LOOP ;
|