Pat O'Sullivan Department of Mathematics and Computer Studies Mary Immaculate College, Limerick, Ireland | |||
General Information Student Resources and Information Interests |
Random Art
We can use Logo's random number generator to produce some random "art". The following is a simple example. You can vary it a little by changing the shape from a square to any other shape you wish and later we will learn how to introduce further variation.
The procedures used are:
The command setheading 0 sets the turtles heading to 0. The turtle's heading is the size of the angle it makes with the vertical. The command is necessary here if you want all the squares to be horizontal because we cannot anticipate the turtle's heading after the command rt random 360. |
||
Department Home | |||
Home |
|