Skip to content

Instantly share code, notes, and snippets.

@farruhha
Created October 19, 2018 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farruhha/67f8ad34e614ccc046f3b726815bb6c6 to your computer and use it in GitHub Desktop.
Save farruhha/67f8ad34e614ccc046f3b726815bb6c6 to your computer and use it in GitHub Desktop.
sicp(MIT)-1 created by farruh - https://repl.it/@farruh/sicpMIT-1
;Exec 1.1
10
(+ 5 3 4)
(- 9 1)
(/ 6 2)
(+ (* 2 4) (- 4 6))
(define a 3)
(define b (+ a 1))
(+ a b (* a b))
(= a b)
(if (and (> b a) (< b (* a b)))
b
a)
(cond ((= a 4) 6)
((= b 4) (+ 6 7 a))
(else 25))
(+ 2 (if (> b a) b a)
(* (cond ((> a b) a)
((< a b) b)
(else -1))
(+ a 1)
)
;Exec 1.2
(/ (+ 5 4 (- 2 (- 3 (- 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7)))
;Exec 1.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment