NetLogo is a computer programming language that can make various shapes and sizes. Logo uses turtle models and command box to carry out scripts.
A triangle is one of the simplest figures you can make in Logo. Here's the script:
Pretty short isn't it? Scripting just simplifies the amount of words you use to make a function.
'To triangle' really means "program a triangle".
'Pd' means "pen-down", which actually refers to the turtle. Using 'pd' in a script will allow the turtle to leave a trail when it moves.
'Repeat' kind of explains itself. It makes the following words repeat [insert number here] amount of times. Repeats start with an opening bracket and ends with a closing bracket.
'Fd' means "forward". For example, if you type 'fd 10', the turtle will move 10 steps forward.
'Rt' refers to the angle the turtle's pointing at. If you type 'rt 180', the turtle will turn in the opposite direction.
This pretty much explains the triangle script. Though there are many more scripts on this page, I will only be explaining a few...
This is a polygon I made with loops and turtles. Here's the script:
'Repeat numberofsides' represents how many times the following action should be repeated, which corresponds to the number of sides the object has.
Last of all, since a polygon is a 360 degree figure, you divide 360 by the number of sides the object has.
A circle is a 360 degree closed figure. Here's the script:
This just says for every 10 rt (angle) turned, move 1 step forward for 37 times.
This is a unique flower I made. Though it's suppose to be 12 petals, I decided to challenge myself and let the script be more complicated The script for this is stated below:
Since this script is quite long, I won't be explaining it, but there are some content in this script that is similar to the polygon's.
The second to last line, die, simply means die! For the turtle, that is.
In this picture, conditionals are present. Conditionals are words that say what state the script is in (Ex. True/False).
I made a program that shows whether or not a number can be divisible by 3 WITHOUT a remainder.
The script above is used to find out whether or not a number can be divided by 3 with no remainder.
If the number CAN be divided by 3 (true), a text will say, "divisible by 3".
If the number CAN'T be divided by 3 (false), a text will say, "not divisible by 3".
While I was using trial-and-error to make a twelve petal flower, I came up with the picture above. I thought it looked interesting, so I decided to add it.
The script for the circular-thing is pictured above.