code exch ( >a >b --- ) sp )+ a0 long move sp )+ a1 long move a0 ) d0 long move a1 ) d1 long move d0 a1 ) long move d1 a0 ) long move c; \ ======================================================================== variable color variable dx variable dy variable incr1 variable incr2 variable d variable x variable y variable flag variable x0 variable y0 variable x1 variable y1 variable x2 variable y2 variable xxx variable yyy variable xdir variable ydir variable >xsel variable >ysel : fline ( x1 y1 x2 y2 --- ) y2 ! x2 ! y1 ! x1 ! flag off x2 @ x1 @ - \ x2-x1 dup x0 ! dup 0> if 1 else -1 then xdir ! abs dup dx ! \ dx y2 @ y1 @ - \ dx y2-y1 dup y0 ! dup 0> if 1 else -1 then ydir ! abs dup dy ! \ dx dy x1 @ y1 @ color @ plot < if \ x2 y2 exch dx dy exch x1 y1 exch x0 y0 exch xdir ydir exch flag on then dy @ 2* \ dy<<1 dup dx @ - d ! incr1 ! \ dy @ dx @ - 2* incr2 ! \ x0 @ 0> if 1 else -1 then xdir ! \ y0 @ 0> if 1 else -1 then ydir ! begin x1 @ x2 @ - while xdir @ x1 +! d @ 0< if incr1 else ydir @ y1 +! incr2 then @ d +! x1 @ y1 @ flag @ if swap then color @ plot repeat ; \ ======================================================================== defer line ' fline is line : foo [ hex ] 100 rnd 100 rnd 100 rnd 100 rnd 100 rnd color ! line ; : bar 0 do foo loop ; get_fb \ fb _fb ! .( Done.) cr