;;;          Turtle graphics in 3-LISP
;;;          -------------------------
;;; 
;;; {phylum}<3-lisp>course>simpleg.dcom must first be loaded into the Interlisp world.
;;; 

(define CENTER
   (let [[fun \(primitive-ccons global '[] '(center) "center" 'center)]]
      (lambda []
         (begin (fun) "ok"))))

(define CLEARWINDOW
   (let [[fun \(primitive-ccons global '[] '(clearwindow)
                   "clearwindow" 'clearwindow)]]
      (lambda []
         (begin (fun) "ok"))))

;;; POINT isn't needed in the problem set:
;;; 
;;; (define POINT
;;;    (let [[fun \(primitive-ccons global '[direction] '(point direction)
;;;                    "point" 'point)]]
;;;       (lambda [direction]
;;;          (begin (fun direction) "ok"))))

(define FORWARD
   (let [[fun \(primitive-ccons global '[amount] '(forward amount)
                   "forward" 'forward)]]
      (lambda [amount]
         (begin (fun amount) "ok"))))

(define JUMP
   (let [[fun \(primitive-ccons global '[amount] '(jump amount)
                   "jump" 'jump)]]
      (lambda [amount]
         (begin (fun amount) "ok"))))

(define LEFT
   (let [[fun \(primitive-ccons global '[degrees]
                   '(left degrees) "left" 'turn)]]
       (lambda [degrees]
          (begin (fun degrees) "ok"))))

(define RIGHT
   (lambda [degrees]
      (left (- 360 degrees))))