Looking for Public Domain Version of Logo

Quote:

>>%%Vidar Larsen, PVV IDT/NTH/UNIT, <http://www.pvv.unit.no/~fvlarsen/>

>>/a{def}def/t{translate}a/r{rotate}a/d{dup}a/M{exch}a/m{moveto}a/f{0 0

>>m d 0 M lineto 0 M t}a/s{d f 60 r d 3 div k 60 r d f}a/k{d 1 gt{s -120

>>r s pop}{3 mul d f -120 r f}ifelse}a 162 -30 50 200 t r k stroke showpage

>Uhhh... this is comp.lang.logo not comp.lan.postscript....

>Care to post the LOGO version of that .sig? ;-)

Actually, it is more LOGO than you may think. It is a (small) PS

implementation of simple "LOGO turtle gfx" inspired functionality, in

order to draw a Koch-like fractal, a famous LOGO example.

To translate:

line one introduces abbreviations.

the f function is equivalent to FD in LOGO

the r (basic rotate) is equivalent to a RT in LOGO

the s function implements the SIDE (see below)

the k function implements the KOCH (see below)

the end of the last line prepares and runs the k

LOGO:

TO SIDE :LEN

FD :LEN

RT 60

KOCH :LEN / 3

RT 60

FD :LEN

END

TO KOCH :LEN

IF :LEN > 1

[SIDE :LEN RT -120 SIDE :LEN]

[FD 3 * :LEN RT -120 FD 3 * :LEN]

END

(I don't remember; is this the right way to write it-then-else in LOGO?)

run with: RT -30 KOCH 162

Of course, looking at it in LOGO, I think I would rather write it:

TO SIDE :LEN

IF :LEN > 1

[FD :LEN RT 60 KOCH :LEN / 3 RT 60 FD :LEN]

[FD 3 * :LEN]

END

TO KOCH :LEN

SIDE :LEN RT -120 SIDE :LEN

END

which seems to make more sense, semantically.

This would translate into a new PS-sig like:

/a{def}def/t{translate}a/r{rotate}a/d{dup}a/M{exch}a/m{moveto}a/f{0 0

m d 0 M lineto 0 M t}a /s{d 1 gt{d f 60 r d 3 div k 60 r d f}{d 3 mul

f} ifelse}a /k{s -120 r s pop} a 162 -30 50 200 t r k stroke showpage

which is actually shorter, and better, and lines up nicely on the

length. Thank you for pointing this out to me!

Well, I guess nobody read this far, but I at least got something out

of it: a new sig! (see below...)

--

%%Vidar Larsen, PVV IDT/NTH/UNIT, <http://www.pvv.unit.no/~fvlarsen/>

/a{def}def/t{translate}a/r{rotate}a/d{dup}a/M{exch}a/m{moveto}a/f{0 0

m d 0 M lineto 0 M t}a /s{d 1 gt{d f 60 r d 3 div k 60 r d f}{d 3 mul

f} ifelse}a /k{s -120 r s pop} a 162 -30 50 200 t r k stroke showpage