Giter Site home page Giter Site logo

fp1's Introduction

Sean Berube

My Library: Turtle Graphics

###Narrative: I used the turtle graphics library. At first I familiarized myself with some basic functions such as move, draw, erase, and turn. After figuring out how to navigate the turtle, I delved into more complex functions such as split, which clones a turtle, and regular-poly which creates a certain number of n-sided shapes. My favorite function is neato, which is the main source of the cool designs.

###Highlights: The code below shows how I cloned the turtles (split) and how I navigated them while drawing lines that traced their path (draw-offset). The two arguments of draw-offset are the amount of space to move the turtle horizontally and vertically, respectively. The argument to split makes it so the cloned turtle faces the original in a right angle.

  • (draw-offset 240 250)
  • (split (turn/radians (/ pi 2)))
  • (split (turn/radians (/ pi 2)))
  • (draw-offset -100 -200)

These two lines are the main cause of the aesthetic appeal to my file. Regular polys drew squares and pentagons with a radius of 2, and neato did the really complex circular designs.

  • (regular-polys 4 2)
  • (regular-polys 5 2)
  • (neato)

The last function I thought was neat was dotted-lines, which does as its name says - makes dotted lines emanate through each respective turtle. However, I excluded it from my code because it would have made the output distorted and overwhelming.

  • (dotted-lines)

###Output/Diagram This image comprises my output itself, so I thought I would combine the output/diagram sections with this one image. Each red triangle represents a turtle. Although I cloned a few turtles from the split function, they have ultimately been multplied exponentially (and in a circular notation) due to the neato function.

alt tag

fp1's People

Contributors

sberube484 avatar marksherman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.