-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.cn.test
74 lines (68 loc) · 1.03 KB
/
core.cn.test
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
: kkk
"kkk took my baby away !" write-string
cr
end
; define-function
: factorial
<< number -- number >>
dup
one? if
end
then
dup sub1 factorial
mul
end
; define-function
: factorial,test
cr
1 factorial . cr
2 factorial . cr
3 factorial . cr
4 factorial . cr
5 factorial . cr
6 factorial . cr
7 factorial . cr
8 factorial . cr
9 factorial . cr
10 factorial . cr
11 factorial . cr
12 factorial . cr
13 factorial . cr
14 factorial . cr
15 factorial . cr
16 factorial . cr
17 factorial . cr
18 factorial . cr
19 factorial . cr
20 factorial . cr
end
; define-function
: .12
<< 1 2 -- >>
2 equal? if
"(^-^)" write-string
1 equal? if
"\^o^/" write-string
else
" " write-string
then
else
" " write-string
1 equal? if
"\^o^/" write-string
else
" " write-string
then
then
end
; define-function
: .12,test
cr
1 2 .12 cr
6 2 .12 cr
1 6 .12 cr
6 6 .12 cr
end
; define-function
factorial,test
.12,test