Changeset View
Changeset View
Standalone View
Standalone View
stand/forth/frames.4th
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | 0 do | ||||
v_el @ xemit | v_el @ xemit | ||||
1+ | 1+ | ||||
2dup | 2dup | ||||
loop | loop | ||||
2drop 2drop drop | 2drop 2drop drop | ||||
; | ; | ||||
: box ( w h x y -- ) \ Draw a box | : box ( w h x y -- ) \ Draw a box | ||||
framebuffer? if | |||||
s" term-drawrect" sfind if | |||||
>R | |||||
rot ( w x y h ) | |||||
over + >R ( w x y -- R: y+h ) | |||||
swap rot ( y x w -- R: y+h ) | |||||
over + >R ( y x -- R: y+h x+w ) | |||||
swap R> R> R> execute | |||||
exit | |||||
else | |||||
drop | |||||
then | |||||
then | |||||
\ Non-framebuffer version | |||||
2dup 1+ 4 pick 1- -rot | 2dup 1+ 4 pick 1- -rot | ||||
vline \ Draw left vert line | vline \ Draw left vert line | ||||
2dup 1+ swap 5 pick + swap 4 pick 1- -rot | 2dup 1+ swap 5 pick + swap 4 pick 1- -rot | ||||
vline \ Draw right vert line | vline \ Draw right vert line | ||||
2dup swap 1+ swap 5 pick 1- -rot | 2dup swap 1+ swap 5 pick 1- -rot | ||||
hline \ Draw top horiz line | hline \ Draw top horiz line | ||||
2dup swap 1+ swap 4 pick + 5 pick 1- -rot | 2dup swap 1+ swap 4 pick + 5 pick 1- -rot | ||||
hline \ Draw bottom horiz line | hline \ Draw bottom horiz line | ||||
Show All 11 Lines |