Difference between revisions of "Snowflake Assignment"
Jump to navigation
Jump to search
(16 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
[https://docs.racket-lang.org/teachpack/2htdpimage.html Racket Image Library Documentation] | [https://docs.racket-lang.org/teachpack/2htdpimage.html Racket Image Library Documentation] | ||
==placement== | ==placement== | ||
− | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._beside%29%29 beside] | + | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._beside%2Falign%29%29 beside/align] |
− | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29. | + | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._flip-vertical%29%29 flip-vertical] |
− | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29. | + | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._above%2Falign%29%29 above/align] |
+ | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._overlay%2Falign%2Foffset%29%29 overlay/align/offset] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rotate%29%29 rotate] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rotate%29%29 rotate] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | =Snowflake= | + | ==line== |
− | (define (snowflake len iter is-flipped) | + | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._line%29%29 line] |
+ | |||
+ | ==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= | ||
+ | ==Snowflake== | ||
+ | <nowiki>(define (snowflake len iter is-flipped) | ||
(raise (error 'not-yet-implemented))))) | (raise (error 'not-yet-implemented))))) | ||
Line 24: | Line 29: | ||
(define (snowflake-flipped len iter) | (define (snowflake-flipped len iter) | ||
− | (snowflake len iter | + | (snowflake len iter #t))</nowiki> |
− | |||
− | |||
− | |||
− | |||
+ | ===Symmetric=== | ||
{| class="wikitable" style="text-align: center; " | {| class="wikitable" style="text-align: center; " | ||
− | |[[File:Snowflake-symmetric_0.svg | + | |[[File:Snowflake-symmetric_0.svg]] |
− | |[[File:Snowflake-symmetric_1.svg | + | |[[File:Snowflake-symmetric_1.svg]] |
− | |[[File:Snowflake-symmetric_2.svg | + | |[[File:Snowflake-symmetric_2.svg]] |
− | |[[File:Snowflake-symmetric_3.svg | + | |[[File:Snowflake-symmetric_3.svg]] |
− | |[[File:Snowflake-symmetric_4.svg | + | |[[File:Snowflake-symmetric_4.svg]] |
|- | |- | ||
− | | | + | |iter=0 |
− | | | + | |iter=1 |
− | | | + | |iter=2 |
− | | | + | |iter=3 |
− | | | + | |iter=4 |
|} | |} | ||
− | ==Flipped== | + | ===Flipped=== |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" style="text-align: center; " | {| class="wikitable" style="text-align: center; " | ||
− | |[[File: | + | |[[File:Snowflake-flipped_0.svg]] |
− | + | |[[File:Snowflake-flipped_1.svg]] | |
− | + | |[[File:Snowflake-flipped_2.svg]] | |
− | |[[File: | + | |[[File:Snowflake-flipped_3.svg]] |
− | |[[File: | + | |[[File:Snowflake-flipped_4.svg]] |
− | |[[File: | ||
− | |[[File: | ||
− | |||
|- | |- | ||
|iter=0 | |iter=0 | ||
Line 78: | Line 59: | ||
|iter=3 | |iter=3 | ||
|iter=4 | |iter=4 | ||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 08:49, 17 November 2020
Contents
Racket Image Library
Racket Image Library Documentation
placement
line
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
iter=0 | iter=1 | iter=2 | iter=3 | iter=4 |
Flipped
iter=0 | iter=1 | iter=2 | iter=3 | iter=4 |