Introduction to Algorithms using Netlogo
What’s an Algorithm Definitions of Algorithm on the Web: –A procedure or formula for solving a problem. –A set of instructions or procedures for solving a problem. –An unambiguous formula or set of rules for solving a problem in a finite number of steps. Algorithms for encryption are usually called Ciphers. –is a procedure or formula for solving problems
Drawing in Netlogo Start Netlogo (under CSCI programs) and resize the display to make the turtle easier to see Click here
Use the command center to create a turtle First define its shape Next create one turtle
Now give commands to the turtle Set to T for turtle Give the command pd for pen down
Begin to draw a box using the commands fd (forward) and lt (left turn)
Make your algorithm into a procedure Commands to create the turtle in a procedure called setup Commands given to the turtle in a procedure called go
Create 2 buttons to run your procedures Use the button icon on the interface toolbar. Runs the setup procedure
Try out your new buttons
Less typing?