Skip to content

timLarocque/FP3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(teachpacks/racket-turtle)

My name: Tim Larocque

My Thought Process

After testing out the (graphics/turtles) last time, I found that it was rather lackluster in its drawing capabilities. I wanted to continue on the path of drawing images, so I decided to go with this library. After reading through the commands that the library uses, I confronted the examples that were given and decided to play around with the spiral image example.

The Core of the Code

(define (spiral x w a times)
  (if (<= times 0)
      empty
      (cons (side x w a)
            (spiral (+ x 5)
                    (+ w 1)
                    a
                    (sub1 times)))))

The above code builds the list of commands that the draw function will use to draw the spiral to the screen. "side" is a list of commands that will draw a segment of the spiral to the window. I decided to play around with the input parameters to "spiral" and choose various angles to see what kind of spiral would be produced.

Outputs with Their Function Calls

(define spiral-image0 (list (change-color COLORS)
                            (spiral 1 1 45 45)))

spiral0

(define spiral-image (list (change-color COLORS)
                           (spiral 1 1 30 30)))

spiral

(define spiral-image2 (list (change-color COLORS)
                            (spiral 1 1 50 40)))

spiral2

(define spiral-image3 (list (change-color COLORS)
                            (spiral 1 1 70 40)))

spiral3

About

final project exploration #2: use a Racket library that will be part of your final project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Racket 100.0%