CSCI 1006 Lecture Notes - Lecture 9: Sliders

15 views2 pages
Procedures/ Functions
All procedures begin with to and finish with end
o to name [a b c… ] commands end
If you have parameters, they go in [ ] right after the name
Parameters aren’t used that often in net logo
The context is determined by the first command in the procedure
To square [ n ]
Pd
Repeat 4 [
Fd n
Rt 90 ]
Pu
End
Set
Changes a mutable property (Excludes turtles- who, patches- pxcor/ pycor)
Set property value
Set size 5
Set color red (red = 15)
o Colors are numbers. Black ends in 0. White is 9.9. There are only 14 base
colors that are named. These true colors end in 5.
Set shape “turtle” (quotes are necessary)
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Document Summary

All procedures begin with to and finish with end to name [a b c ] commands end. If you have parameters, they go in [ ] right after the name. Parameters aren"t used that often in net logo. The context is determined by the first command in the procedure. Changes a mutable property (excludes turtles- who, patches- pxcor/ pycor) Set color red (red = 15: colors are numbers. There are only 14 base colors that are named. Turtles directly interact with the patch it"s on top of. Buttons need parameters: use forever button (instead of repeat) Sliders take variables: set variables (1 is standard increment). Boolean operators- and, or, not (goes in front) Comparison operators- >, =, <=, =, != (not equals) If condition is true, commands 1 are executed. If n is a positive integer, return a number such that 0 random < n.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers