Biosphere and Biosquare
BIOSPHERE demonstrates in a fine way how creativity and simplicity work together. The program is only a few lines long and can be explained to anybody in plain words. The slow motion growth of the Biosphere is surprisingly close to nature.
The basic element is a few TURTLE steps. Just FD RANDOM 6 LT RANDOM 45 FD RANDOM 6 RT RANDOM 45. A few steps forwards, a little to the left, a few steps forwards a little to the right. That’s all.
This line is repeated many times, and for every round, TURTLE is asked how far it is from home. If it’s more than the radius of the circle, the TURTLE is ordered to turn round and head for HOME and continue the funny way of random walking. Changing the background to black and the pencolor to white gives an interesting result.
BIOSQUARE works jus like BIOSPHERE but the borderline is a rectangle definened by coordinates. When TURTLE walking along its staggering way crosses the coordinates, it is ordered to turn round and head for home still staggering.
BIOSQUARE is as excellent playground for experiments with LOGO. Nothing can go wrong if you have saved the original version of the program, and even if you are a genius some of the most interesting results may come from your mistakes. The only issue is to remember what you did wrong to get such a good result.
FD RANDOM 6 LT RANDOM 45 FD RANDOM 6 RT RANDOM 40 is the basic module in BIOSPHERE and BIOSQUARE. A few steps forwards, a little to the left, a few steps forwards a little to the right. That’s all. If you are experimenting then the end of that line is the place where you put new commands if you want to change the width of the line, the color or behavior (PX) of the pen. Try to change the background color to black and the pen color to white. In the example with the circles, TURTLE walks with pen up and occasionally stops, lowers the pen and drops a circle using STAMPCIRCLE.
Biosphere.lgo
TO BIOSPHERE
CS FS SETWIDTH 1 MAKE "D 0 MAKE "G 0
LABEL "ONESTEP
make "g :g+1 IF :G > 16000 [STOP]
IF :D>200 [ PU]
PD FD RANDOM 6 LT RANDOM 45 FD RANDOM 6 RT RANDOM 40
MAKE "D DISTANCE [0 0]
IF :D > 300 [PU SETH TOWARDS [0 0] FD RANDOM 30 RT RANDOM 60 LT RANDOM 60 PD]
GO "ONESTEP
END
Biosquare.lgo
TO BIOSQUARE
CS FS SETWIDTH 1 MAKE "G 0
LABEL "ONESTEP
MAKE "G :G + 1 IF :G > 16000 [STOP]
GOHOME FD RANDOM 6 LT RANDOM 45 FD RANDOM 6 RT RANDOM 40
SETPC RANDOM 16 PD (STAMPOVAL 10 10 "TRUE) PU
GO "ONESTEP
END
TO GOHOME
IF OR (XCOR > 300) (YCOR > 250) SETH TOWARDS [0 0]
IF OR (XCOR < -300) (YCOR < -250) SETH TOWARDS [0 0]
END
Procedure | BIOSPHERE, BIOSQUARE |
Description | Logo Art |
Level | Beginner |
Tags | Art, Graphics |