;;; Your entry for the Scheme contest
;;; Siu Kwan Dave Ho cs61a -it
;;; Marty Ren cs61a-iw
;;; Special Thanks to awesome TA: Richard Lan
;;; Title: Reeling Python Hidden Dragon
;;;
;;; Description:
;;; The Ouroboros
;;; Beneath great Hilfinger's thumb
;;; Suffers eternal
(define current 2)
(define (increment n)
(* n 2)
)
(define (deinc n)
(/ n 2)
)
(define (body1 n)
(begin
(set! current (increment current))
(forward current)
(left 45)
(forward current)
(right 45)
(forward current)
(right 45)
)
(if (> n 0)
(body2 (- n 1))
(begin
(forward current)
(left 45)
(head)
)
)
)
(define (body2 n)
(begin
(set! current (increment current))
(forward current)
(right 45)
(forward current)
(left 45)
(forward current)
(left 45)
)
(if (> n 0)
(body1 (- n 1))
(begin
(head)
)
)
)
(define (head)
(begin
(forward current)
(left 67.5)
(forward (/ current 4))
(right 45)
(forward (/ current 6))
(right 22.5)
(forward (/ current 8))
(left 45)
(forward 1)
(right 45)
(backward (/ current 8))
(left 45)
(forward (/ current 8))
(left 45)
(forward 1)
(right 45)
(backward (/ current 8))
(right 22.5)
(backward (/ current 6))
(left 45)
(forward (/ current 4))
(left 45)
(forward (/ current 2))
)
)
(define (drawwrap n)
(begin
(forward current)
(left 45)
(set! current
(deinc current)
)
(body1 n)
)
)
(penup)
(backward 64)
(right 45)
(forward 32)
(left 45)
(pendown)
(drawwrap 5)
'(The Ouroboros)
'(Beneath great Hilfingers thumb)
'(Suffers eternal)