CSCI 1006 Lecture 1: Basics

39 views3 pages

Document Summary

Crt # - creates # amount of turtles. Pd pen down, used to draw shapes. * draw a figure using a turtle"s pen. Draw a circle fd (radius #) pd repeat 360. Draw an n-gon pd repeat n [rt 360 / n fd len] pu. * command a turtle to do something when it encounters a specified patch type if (pcolor = {color}) [command] * use the random command to do things, including specifying the percent chance of taking an action. To 4colores (so that there"s a 25% of each patch having one of 4 colors) ifelse (random 4 = 0) ; this is because some color patches will overlap when you call random. To sprinkle if (random 100 < slider_percentage) [set pcolor blue] to border pd wiggle ifelse ((abs xcor < 10) and (abs ycor < 10)) * figure out what a mystery procedure does.

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

Related Documents