-
Notifications
You must be signed in to change notification settings - Fork 0
/
any.any
88 lines (72 loc) · 1.68 KB
/
any.any
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(=:^' s' (lt' (q' [
(= $+' (:^' (:^' s'))
(lt' (:' s' '4 '0 '1) ((:' s' '5 '0 '2))))
(=. =:>' (:^' (:|' (lu' (:^' s') (:' s' '6 '0 '1))))
((:' s' '4 '0 '2)))
(dl $-' (:' (lu' (:^' s') (:' s' '5 '0 '1)) '-2)
(:^' (:|' (lu' (:^' s') (:' s' '6 '0 '1)))))
(do sv'
(=:^' s' (lt' (st') (:^' s')))
(=:>' (:|' (:' s' '5)) (lt' ((lt' sv' (:>' (:' s' '8 '0)))) ()))
(=:' s' (lt' (:>' (:^' s')) (:@' s' '5)))
)
(?? ?' ((:' s' '4 '0 '1)) (sv'
((:' s' '5 '0 '2))
(=:>' s' (:@' s' '5))
))
(__fn sv'
(=:^' s' (lt' (st' (lt' (q' __1) (:' s' '7 '0 '1))
(lt' (q' __2) (:>' (:' s' '9 '0))))
(:^' s')))
(?? __2 (sv'
($+' (:^' (:^' s')) (lt' (:^' __1) ((:^' __2))))
(=. __1 (:>' __1))
(=. __2 (:>' __2))
))
(dl __1)
(dl __2)
(=:>' (:|' (:' s' '6)) (lt' ((:' s' '6 '0 '2)) ()))
(=:' s' (lt' (:>' (:^' s')) (:@' s' '6)))
)
(** __fn (b e) (?' (>' e '0) (*' b (** b (-' e '1))) '1))
(testXDf ?' (lu' (:^' s') (q' x))
(pr' (q' ('54 'a)))
(pr' (q' ('46 'a)))
)
(testRecur ?' x (sv'
(pr' x)
(=. x (:>' x))
(testRecur)
))
(test?? ?? x (sv'
(pr' x)
(=. x (:>' x))
))
]) (:^' s')))
#' test code '#
#' (= answer (q' ('34 '32 'a)))
(pr' answer)
(=. answer (q' ('30 '31 'a)))
(pr' answer) '#
#' (= x '1)
(testXDf)
(dl x)
(testXDf) '#
#' (do
(= x '1)
(testXDf)
)
(testXDf)
(pr' (do
(testXDf)
(q' ('31 'a))
)) '#
#' (= x (q' ('30 '31 '32 'a)))
(testRecur)
(=. x (q' ('30 '31 '32 'a)))
(test??) '#
#' (= x (<' (>' '31 '30) '31 '32))
(pr' (lt' (?' x x '46) 'a ())) '#
#' (= x '2)
(= y '3)
(pr' (lt' (+' '30 (** x y)) 'a ())) '#