Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions FP2.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#lang racket

(require graphics/turtles)
(turtles)

;;(draw 30)

;(turn/radians (/ pi 2))
;(draw 100)

(split (turn/radians (/ pi 2)))
(split (turn/radians (/ pi 2)))
(split (turn/radians (/ pi 2)))

(draw 10)


;(turn/radians (/ (* 3 pi) 2))
;(draw 100)

;(turn/radians (/ pi 2))
;(draw 100)

;(turn/radians (/ (* 3 pi) 2))
;(draw 100)




(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))))

93 changes: 51 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
# FP3: Final Project Assignment 3: Exploration 2
Due Sunday, March 26, 2017

This assignment is the same as [FP1], except definitely choose a library that you expect to use for your full project.

You will be in your team before you complete this assignment. You and your teammate(s) must coordinate to (1) both choose libraries relevant to your project, and (2) each choose a different library.

The report template is below, beginning with "Library Name Here."

## How to Prepare and Submit This Assignment

1. To start, [**fork** this repository][forking].
1. Add your `.rkt` Racket source file(s) to the repository.
1. Add any images to the repository.
1. Modify the `README.md` file and [**commit**][ref-commit] changes to complete your report.
1. Ensure your changes (report in `md` file, added `rkt` file(s), and images) are committed to your forked repository.
1. [Create a **pull request**][pull-request] on the original repository to turn in the assignment.

## Library Name Here
My name: **put your real name here**
## Turtles
My name: Scott Quinn

Write what you did!
Remember that this report must include:
Expand All @@ -27,25 +9,52 @@ Remember that this report must include:
* output from your code demonstrating what it produced
* at least one diagram or figure showing your work

The narrative itself should be no longer than 350 words.

You need at least one image (output, diagrams). Images must be uploaded to your repository, and then displayed with markdown in this file; like this:

![test image](/testimage.png?raw=true "test image")

You must provide credit to the source for any borrowed images.

Code should be delivered in two ways:

1. Full files should be added to your version of this repository.
1. Key excerpts of your code should be copied into this .md file, formatted to look like code, and explained.

<!-- Links -->
[FP1]: https://github.com/oplS17projects/FP1
[schedule]: https://github.com/oplS17projects/FP-Schedule
[markdown]: https://help.github.com/articles/markdown-basics/
[forking]: https://guides.github.com/activities/forking/
[ref-clone]: http://gitref.org/creating/#clone
[ref-commit]: http://gitref.org/basic/#commit
[ref-push]: http://gitref.org/remotes/#push
[pull-request]: https://help.github.com/articles/creating-a-pull-request
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.
```racket
#lang racket

(require graphics/turtles)
(turtles)

(draw 30)
```
![a](/a.jpg?raw=true"a")
Then I tried turning it.

```racket
(turn/radians (/ pi 2))
(draw 100)
```

![turn](/turn.jpg?raw=true"true")


I then split the turtle into multiple parts
```racket
(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.

![1](/1.jpg?raw=true"1")

So I made a function that could do that instead of doing repeated calls manually.
```racket
(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))))
```
![2](/2.jpg?raw=true"2")
![3](/3.jpg?raw=true"3")
![4](/4.jpg?raw=true"4")
![5](/5.jpg?raw=true"5")

I enjoyed the symmetry of the pictures and decided that was enough.
Binary file added a.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added turn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.