Download - Clojure - LDC
Transcript
![Page 1: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/1.jpg)
![Page 2: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/2.jpg)
MAX
![Page 3: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/3.jpg)
Max● (max 1 2 27 42 33)● = 42
![Page 4: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/4.jpg)
Min
![Page 5: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/5.jpg)
MIN● (min 1 2 27 42 33)● = 1
![Page 6: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/6.jpg)
Rand
![Page 7: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/7.jpg)
Rand● (rand 10)● 7.99291708123879● (rand 10)● 4.400075418607131● (rand 10)● 3.945087811483189
![Page 8: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/8.jpg)
Rand-Int● (rand-int 10)● 3● (rand-int 10)● 9● (rand-int 10)● 7
![Page 9: Clojure - LDC](https://reader038.vdocument.in/reader038/viewer/2022100600/5562d84ad8b42a63498b5134/html5/thumbnails/9.jpg)
Tema● (defn
● calc
● "calculadora tema do ldc!!!"
● [o x y]
● (if (= "+" o) (+ x y)
● (if (= "-" o) (- x y)
● (if (= "*" o) (* x y)
● (if (= "/" o) (/ x y))))))
●
● (prn (calc "+" 4 5)) ;; Retorno deve ser: 9
● (prn (calc "-" 5 1)) ;; Retorno deve ser: 4
● (prn (calc "*" 2 3)) ;; Retorno deve ser: 6
● (prn (calc "/" 27 3)) ;; Retorno deve ser: 9