-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanh-3d
More file actions
21 lines (21 loc) · 760 Bytes
/
manh-3d
File metadata and controls
21 lines (21 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(define manh-3d ; val: integer
(lambda (i j k) ; i,j,k: val. integers positive
(cond ((and (= i 0) (= j 0) (= k 0))
1)
((and (= i 0) (= j 0) (> k 0))
1)
((and (= i 0) (> j 0) (= k 0))
1)
((and (= i 0) (> j 0) (> k 0))
(+ (manh-3d j (- k 1) 0) (manh-3d k (- j 1) 0)))
((and (> i 0) (= j 0) (= k 0))
1)
((and (> i 0) (= j 0) (> k 0))
(+ (manh-3d i (- k 1) 0) (manh-3d k (- i 1) 0)))
((and (> i 0) (> j 0) (= k 0))
(+ (manh-3d i (- j 1) 0) (manh-3d j (- i 1) 0)))
((and (> i 0) (> j 0) (> k 0))
(+ (manh-3d (- i 1) j k) (manh-3d (- j 1) i k) (manh-3d (- k 1) i j)))
))
)
; how are you?