-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocks.fth
1 lines (1 loc) · 9 KB
/
blocks.fth
1
block #000 boot block 3 load 5 load rbforget 1 load ; edblock @ edit ; lsz" ls -l" system ; lgz" lazygit" system ; ." c4a - " green .version white 2 block ! - these are for executing from the editor - ls lg 0 flush blocks z" ccc dev" system z" git pull" system block #003 - strings find fill loaded? p1vhere $100 + ; p2p1 $100 + ; fill(to num char--)swap ?dup if>t swap t> for over over c! 1+ nextthen2drop ; fill-c(to num char--)swap ?dup if>t swap t> for over over ! cell+ next 2dropthen; cmove(src dst n--)>r >t >a r> ?dupiffor @a+ !t+ nextthenatdrop ; cmove>(src dst n--)>r r@ + >t r@ + >a r> ?dupif1+ for @a- !t- nextthenatdrop ; block #004 - doc for string words block #005 - screen words find cls loaded? cur-on(--)." %e[?25h" ; cur-off(--)." %e[?25l" ; cur-block(--)." %e[2 q" ; cur-bar(--)." %e[5 q" ; ->cr(r c--)." %e[%d;%dH" ; ->rc(c r--) swap ->cr ; cls(--)." %e[2J" 1 1 ->rc ; clr-eol(--)." %e[0K" ; color(bg fg--)." %e[%d;%dm" ; fg(fg--)." %e[38;5;%dm" ; white255 fg ; red 203 fg ; green 40 fg ; yellow226 fg ; blue 63 fg ; purple201 fg ; cyan 117 fg ; grey 250 fg ; .color(c--c)dup dup fg ." color-%d%n" ; colors(f t--)over - 1+ for .color 1+ next drop white ; block #006 - doc for screen words block #007 - some simple benchmarks mil1000 dup * * ; bmtimer swap for next timer swap - . ; bb1000 mil bm ; block #008 - doc for benchmarks