17b753b61SAndrzej Bialecki\ Words implementing frame drawing 27b753b61SAndrzej Bialecki\ XXX Filled boxes are left as an exercise for the reader... ;-/ 37b753b61SAndrzej Bialecki 47b753b61SAndrzej Bialeckimarker task-frames.4th 57b753b61SAndrzej Bialecki 67b753b61SAndrzej Bialeckivariable h_el 77b753b61SAndrzej Bialeckivariable v_el 87b753b61SAndrzej Bialeckivariable lt_el 97b753b61SAndrzej Bialeckivariable lb_el 107b753b61SAndrzej Bialeckivariable rt_el 117b753b61SAndrzej Bialeckivariable rb_el 127b753b61SAndrzej Bialeckivariable fill 137b753b61SAndrzej Bialecki 147b753b61SAndrzej Bialecki\ Single frames 157b753b61SAndrzej Bialecki196 constant sh_el 167b753b61SAndrzej Bialecki179 constant sv_el 177b753b61SAndrzej Bialecki218 constant slt_el 187b753b61SAndrzej Bialecki192 constant slb_el 197b753b61SAndrzej Bialecki191 constant srt_el 207b753b61SAndrzej Bialecki217 constant srb_el 217b753b61SAndrzej Bialecki\ Double frames 227b753b61SAndrzej Bialecki205 constant dh_el 237b753b61SAndrzej Bialecki186 constant dv_el 247b753b61SAndrzej Bialecki201 constant dlt_el 257b753b61SAndrzej Bialecki200 constant dlb_el 267b753b61SAndrzej Bialecki187 constant drt_el 277b753b61SAndrzej Bialecki188 constant drb_el 287b753b61SAndrzej Bialecki\ Fillings 297b753b61SAndrzej Bialecki0 constant fill_none 307b753b61SAndrzej Bialecki32 constant fill_blank 317b753b61SAndrzej Bialecki176 constant fill_dark 327b753b61SAndrzej Bialecki177 constant fill_med 337b753b61SAndrzej Bialecki178 constant fill_bright 347b753b61SAndrzej Bialecki 357b753b61SAndrzej Bialecki: hline ( len x y -- ) \ Draw horizontal single line 367b753b61SAndrzej Bialecki at-xy \ move cursor 377b753b61SAndrzej Bialecki 0 do 387b753b61SAndrzej Bialecki h_el @ emit 397b753b61SAndrzej Bialecki loop 407b753b61SAndrzej Bialecki; 417b753b61SAndrzej Bialecki 427b753b61SAndrzej Bialecki: f_single ( -- ) \ set frames to single 437b753b61SAndrzej Bialecki sh_el h_el ! 447b753b61SAndrzej Bialecki sv_el v_el ! 457b753b61SAndrzej Bialecki slt_el lt_el ! 467b753b61SAndrzej Bialecki slb_el lb_el ! 477b753b61SAndrzej Bialecki srt_el rt_el ! 487b753b61SAndrzej Bialecki srb_el rb_el ! 497b753b61SAndrzej Bialecki; 507b753b61SAndrzej Bialecki 517b753b61SAndrzej Bialecki: f_double ( -- ) \ set frames to double 527b753b61SAndrzej Bialecki dh_el h_el ! 537b753b61SAndrzej Bialecki dv_el v_el ! 547b753b61SAndrzej Bialecki dlt_el lt_el ! 557b753b61SAndrzej Bialecki dlb_el lb_el ! 567b753b61SAndrzej Bialecki drt_el rt_el ! 577b753b61SAndrzej Bialecki drb_el rb_el ! 587b753b61SAndrzej Bialecki; 597b753b61SAndrzej Bialecki 607b753b61SAndrzej Bialecki: vline ( len x y -- ) \ Draw vertical single line 617b753b61SAndrzej Bialecki 2dup 4 pick 627b753b61SAndrzej Bialecki 0 do 637b753b61SAndrzej Bialecki at-xy 647b753b61SAndrzej Bialecki v_el @ emit 657b753b61SAndrzej Bialecki 1+ 667b753b61SAndrzej Bialecki 2dup 677b753b61SAndrzej Bialecki loop 687b753b61SAndrzej Bialecki 2drop 2drop drop 697b753b61SAndrzej Bialecki; 707b753b61SAndrzej Bialecki 717b753b61SAndrzej Bialecki: box ( w h x y -- ) \ Draw a box 727b753b61SAndrzej Bialecki 2dup 1+ 4 pick 1- -rot 737b753b61SAndrzej Bialecki vline \ Draw left vert line 747b753b61SAndrzej Bialecki 2dup 1+ swap 5 pick + swap 4 pick 1- -rot 757b753b61SAndrzej Bialecki vline \ Draw right vert line 767b753b61SAndrzej Bialecki 2dup swap 1+ swap 5 pick 1- -rot 777b753b61SAndrzej Bialecki hline \ Draw top horiz line 787b753b61SAndrzej Bialecki 2dup swap 1+ swap 4 pick + 5 pick 1- -rot 797b753b61SAndrzej Bialecki hline \ Draw bottom horiz line 807b753b61SAndrzej Bialecki 2dup at-xy lt_el @ emit \ Draw left-top corner 817b753b61SAndrzej Bialecki 2dup 4 pick + at-xy lb_el @ emit \ Draw left bottom corner 827b753b61SAndrzej Bialecki 2dup swap 5 pick + swap at-xy rt_el @ emit \ Draw right top corner 837b753b61SAndrzej Bialecki 2 pick + swap 3 pick + swap at-xy rb_el @ emit 847b753b61SAndrzej Bialecki 2drop 857b753b61SAndrzej Bialecki; 867b753b61SAndrzej Bialecki 877b753b61SAndrzej Bialeckif_single 887b753b61SAndrzej Bialeckifill_none fill ! 89