Difference between revisions of "Snowflake Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
==empty-image==
 
==empty-image==
 
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._empty-image%29%29 empty-image]
 
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._empty-image%29%29 empty-image]
 +
 +
=Spiral Demo=
 +
<youtube>AIGeMxka0MQ</youtube>
  
 
=Code to Implement=
 
=Code to Implement=
Line 29: Line 32:
  
 
===Symmetric===
 
===Symmetric===
<nowiki>(define (sierpinski-triangle side-length n)
 
  (raise 'not-yet-implemented #t))</nowiki>
 
 
 
{| class="wikitable" style="text-align: center; "
 
{| class="wikitable" style="text-align: center; "
 
|[[File:Snowflake-symmetric_0.svg]]
 
|[[File:Snowflake-symmetric_0.svg]]
Line 59: Line 59:
 
|iter=3
 
|iter=3
 
|iter=4
 
|iter=4
|}
 
 
==Branch==
 
<nowiki>(define (branch length iter)
 
  (raise 'not-yet-implemented #t))</nowiki>
 
 
{| class="wikitable" style="text-align: center; "
 
|[[File:Branch_0.svg]]
 
|[[File:Branch_1.svg]]
 
|[[File:Branch_2.svg]]
 
|[[File:Branch_3.svg]]
 
|[[File:Branch_4.svg]]
 
|[[File:Branch_5.svg]]
 
|[[File:Branch_6.svg]]
 
|[[File:Branch_7.svg]]
 
|-
 
|iter=0
 
|iter=1
 
|iter=2
 
|iter=3
 
|iter=4
 
|iter=5
 
|iter=6
 
|iter=7
 
 
|}
 
|}

Latest revision as of 08:49, 17 November 2020

Lindenmayer system

Dragon trees.jpg

Racket Image Library

Racket Image Library Documentation

placement

beside/align
flip-vertical
above/align
overlay/align/offset
rotate

line

line

empty-image

empty-image

Spiral Demo

Code to Implement

Snowflake

(define (snowflake len iter is-flipped)
  (raise (error 'not-yet-implemented)))))

(define (snowflake-symmetric len iter)
  (snowflake len iter #f))

(define (snowflake-flipped len iter)
  (snowflake len iter #t))

Symmetric

Snowflake-symmetric 0.svg Snowflake-symmetric 1.svg Snowflake-symmetric 2.svg Snowflake-symmetric 3.svg Snowflake-symmetric 4.svg
iter=0 iter=1 iter=2 iter=3 iter=4

Flipped

Snowflake-flipped 0.svg Snowflake-flipped 1.svg Snowflake-flipped 2.svg Snowflake-flipped 3.svg Snowflake-flipped 4.svg
iter=0 iter=1 iter=2 iter=3 iter=4