diff --git a/1.jpg b/1.jpg new file mode 100644 index 0000000..60ebaec Binary files /dev/null and b/1.jpg differ diff --git a/2.jpg b/2.jpg new file mode 100644 index 0000000..5a62a7e Binary files /dev/null and b/2.jpg differ diff --git a/3.jpg b/3.jpg new file mode 100644 index 0000000..b717c0a Binary files /dev/null and b/3.jpg differ diff --git a/4.jpg b/4.jpg new file mode 100644 index 0000000..ea1a9b6 Binary files /dev/null and b/4.jpg differ diff --git a/5.jpg b/5.jpg new file mode 100644 index 0000000..1fcde61 Binary files /dev/null and b/5.jpg differ diff --git a/FP2.rkt b/FP2.rkt new file mode 100644 index 0000000..20260b3 --- /dev/null +++ b/FP2.rkt @@ -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)))) + diff --git a/README.md b/README.md index dbc599b..c5619fe 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. - - -[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. diff --git a/a.jpg b/a.jpg new file mode 100644 index 0000000..7af99d1 Binary files /dev/null and b/a.jpg differ diff --git a/turn.jpg b/turn.jpg new file mode 100644 index 0000000..99630bc Binary files /dev/null and b/turn.jpg differ