8 constant /d \ length of double struct \ interval /d field i_lower /d field i_upper constant /interval struct \ mandel /interval field m_real /intervel field m_imag /d field m_rside /d field m_iside /w field m_resolution /w field m_maxcount /w field m_mincount /w field m_iterations /n field m_counts constant /mandel \ link in the C stuff requires clink.f \ "" compute.o clink "" fileio.o clink \ "" generate.o clink "" mstat.o clink requires cg.f variable mandx variable mandy variable mandmin variable mandrange variable mandres variable mandcounts : mand-color ( count --- color ) mandmin w@ - 256 mandrange */ ; : putmand ( x y --- ) mandy ! mandx ! \ _mandel m_maxcount w@ \ maxcount _mandel m_mincount w@ \ maxcount mincount dup mandmin w! - 1+ mandrange w! \ _mandel m_resolution w@ mandres w! _mandel m_counts w@ \ counts dup mandcounts w! mandres @ 0 do \ counts i mandy @ + ysel c@ drop mandx @ xsel \ counts dest mandres @ 0 do over /w + \ counts dest ++counts rot w@ \ dest ++counts count mand-color \ dest ++counts color 2 index c! \ dest ++counts swap 1+ \ ++counts ++dest loop drop \ ++counts loop drop \ ;