;; ;;******************************************* ;; ;;Assignment 03, Question 1 ;;(Weird Function) ;; ;;******************************************* ;; (a) (weird 1 2 3) (cond [(symbol? 2) 0] [else (weird (+ 1 2) 3)]) (cond [false 0] [else (weird (+ 1 2) 3)]) (cond false [else (weird (+ 1 2) 3)]) (cond [else (weird (+ 1 2) 3)]) (weird (+ 1 2) 3) (weird 3 3) (cond [(symbol? 3) 0] [else (weird (+ 3 3))]) (cond [false 0] [else (weird (+ 3 3))]) (cond false [else (weird (+ 3 3))]) (cond [else (weird (+ 3 3))]) (weird (+ 3 3)) (weird 6) 6 (b) (weird-fun 1 2 3) (weird 1 2 3) (cond [(symbol? 2) 0] [else (weird (+ 1 2) 3)]) (cond [false 0] [else (weird (+ 1 2) 3)]) (cond false [else (weird (+ 1 2) 3)]) (cond [else (weird (+ 1 2) 3)]) (weird (+ 1 2) 3) (weird 3 3) (cond [(symbol? 3) 0] [else (weird (+ 3 3))]) (cond [false 0] [else (weird (+ 3 3))]) (cond false [else (weird (+ 3 3))]) (cond [else (weird (+ 3 3))]) (weird (+ 3 3)) (weird 6) 6 (c) (weird ¡¯a ¡¯b (/ 5 0)) /: division by zero (d) (weird-fun ¡¯a ¡¯b (/ 5 0)) /: division by zero (e) (strange 5 5) (cond [(= 5 5) (weird 5 (- 5))] [else (weird 5 ¡¯strange)]) (cond [true (weird 5 (- 5))] [else (weird 5 ¡¯strange)]) (weird 5 (- 5)) (weird 5 -5) (cond [(symbol? -5) 0] [else (weird (+ 5 -5))]) (cond [false 0] [else (weird (+ 5 -5))]) (cond [else (weird (+ 5 -5))]) (weird (+ 5 -5)) (weird 0) 0 (f) (strange 8 3) (cond [(= 8 3) (weird 8 (- 3))] [else (weird 8 ¡¯strange)]) (cond [false (weird 8 (- 3))] [else (weird 8 ¡¯strange)]) (cond [else (weird 8 ¡¯strange)]) (weird 8 ¡¯strange) (cond [(symbol? 'strange) 0] [else (weird (+ 8 'strange))]) (cond [true 0] [else (weird (+ 8 'strange))]) 0 (g) (strange ¡¯sarah ¡¯palin) (cond [(= ¡¯sarah ¡¯palin) (weird ¡¯sarah (- ¡¯palin))] [else (weird ¡¯sarah ¡¯strange)]) =: expects type as 1st argument, given: 'sarah; other arguments were: 'palin (h) (cond [(and (weird false) (zero? (weird ¡¯a ¡¯b))) (weird 8 9 10 11 12)] [(or (symbol? ¡°scheme=awesome¡±) (> 3 5) (string 3 5) (string 3 5) (string 3 5) (string 3 5) (string 3 5) (string