[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> A better penreverse?



Ehud Lamm Wrote:

> Well, since no one came up with any suggestion I had to roll my own.

> You can use the procedure fdr below, instead of the normal fd to have the
> pencolor change each time a segment is drwan. This is especially coll with
> various recursive procedures.

> The version below work with only three colors (black/white/red) but can be
> easily extended. Works under MSW.

> to fdr :a
> make "black [000 000 000]
> make "white [255 255 255]
> make "gray  [128 128 128]
> make "red   [255 000 000]
> make "green [000 255 000]
> make "blue  [000 000 255]
> ifelse equalp pixel :white [setpencolor :black][ifelse equalp pixel :black
> [setpencolor :red][setpencolor :white]]
> fd :a
> End
 

Hello Ehud,

You can do the same easily by:

to fdr :size
setpc pencolor+1+random 16
fd :size
end

This makes sure that each line is different in color than its predecessor.

You might than try this:

for[size 0 100 4][fdr :size rt 90]
 

Regards...

[[Yehuda]]
 

    _/    _/     _/ _/_/_/_/_/ _/_/_/_/
   _/   _/     _/_/    _/          _/
  _/_/_/     _/  _/   _/        _/
 _/   _/   _/_/_/_/  _/      _/
_/     _/_/      _/ _/     _/_/_/_/

http://www.geocities.com/CollegePark/lab/2276/
 



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home