My name: Scott Quinn
Write what you did! Remember that this report must include:
- a narrative of what you did
- highlights of code that you wrote, with explanation
- output from your code demonstrating what it produced
- at least one diagram or figure showing your work
I enjoyed the plotting library so I wanted to pick another that had to do with drawing or something to that nature. I picked turtles because it seems simple yet intuitive. I started off with the most basic function. Make the turtle draw a line 30 pixels long.
#lang racket
(require graphics/turtles)
(turtles)
(draw 30)(turn/radians (/ pi 2))
(draw 100)I then split the turtle into multiple parts
(split (turn/radians (/ pi 2)))
(split (turn/radians (/ pi 2)))
(split (turn/radians (/ pi 2)))
(draw 10)I noticed how the draw command affected all of the turtles so I kept calling the turn and draw commands in the REPL.
So I made a function that could do that instead of doing repeated calls manually.
(define (fract n c)
(fract-iter n 0 c))
(define (fract-iter length count mcount)
(if (> count mcount)
count
((turn (random 360))
(draw (random length))
(fract-iter length (+ count 1) mcount))))I enjoyed the symmetry of the pictures and decided that was enough.






