\ Picture words give a flag based on x and y.
0 Value x 0 Value y \ 10000x fixed decimal.
: from-sq ( nn-n) swap - dup 10000 */ ;
: disc ( rxy-f) y from-sq swap x from-sq + > ;
: udisc ( -f) 10000 0 0 disc ;
: vert ( -f) x -1500 -6000 within ;
: horz ( -f) y -2000 -4000 within ;
: smash ( -f) udisc vert and horz and ;
: pair ( r-ff) dup 0 5000 disc swap 0 -5000 disc ;
: wave ( -f) 2500 pair invert x 0< and or ;
: eyes ( -f) 278 pair or ;
: yinyang ( -f) udisc wave xor eyes xor ;
: pit ( -f) x 6000 2000 within y 2000 < or ;
: pit+ ( f-f) pit and x negate y to x to y ;
: manji ( -f) true pit+ pit+ pit+ pit+ ;
\ Emit UTF-8 for Braille U+28XX, given XX.
: emitb8 ( c-) ?dup-0=-IF $40 THEN $E2 emit
dup 6 rshift $A0 or emit $3F and $80 or emit ;
: ~ c, ; \ Dot row/col per Braille bit: 0 3
: Dots ( -;i-c) Create does> + c@ ; \ 1 4
Dots dr 0 ~ 1 ~ 2 ~ 0 ~ 1 ~ 2 ~ 3 ~ 3 ~ \ 2 5
Dots dc 0 ~ 0 ~ 0 ~ 1 ~ 1 ~ 1 ~ 0 ~ 1 ~ \ 6 7
\ Compute pic x/y from screen row/col/dot.
0 Value r 0 Value c 0 Value d
12 dup Constant hgt 2* Constant wid
: axis ( duuuu-dd) * + swap */ 10000 ;
: toy ( -) -5000 hgt d dr 4 r axis + to y ;
: tox ( -) 10000 wid d dc 2 c axis - to x ;
Defer pic ( -f) ' false is pic \ '
: dotbit ( -c) toy tox pic 1 and d lshift ;
: calcb8 ( -c) 0 8 0 DO i to d dotbit or LOOP ;
: line ( -) wid 0 DO i to c calcb8 emitb8 LOOP ;
: 3pic ( -xxx) ['] smash ['] manji ;
: 3line ( xxx-) 2 0 DO is pic line 2 spaces LOOP ;
: 3draw ( -) hgt 0 DO i to r cr 3pic 3line LOOP ;
3draw