-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaths.lisp
More file actions
59 lines (45 loc) · 867 Bytes
/
Copy pathmaths.lisp
File metadata and controls
59 lines (45 loc) · 867 Bytes
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
;; little countdown to test maths
(defun main (args)
"Simple mathematical operations, which will do a count-down from 10-0."
(printint (+ (* 4 2) 2))
(newline)
;; 9
(printint (- 10 1))
(newline)
;; 8
(printint (+ 6 2))
(newline)
;; 7
(printint (/ 14 2))
(newline)
;; 6
(printint (* 3 2))
(newline)
;; 5
(printint (- 30 (* 5 5)))
(newline)
;; 4
(printint (/ 8 2))
(newline)
;; 3
(printint (+ (* 2 1) 1))
(newline)
;; 2
(printint (- (* 10 10) 98))
(newline)
;; 1
(printint (- 0xFF 0b11111110))
(newline)
;; 0
(printint (- 98 98))
(newline)
(let ((n (list 1 2 3 4 5 6 7 8 9 10)))
(print "List ")
(print n)
(newline)
(print "Even:")
(print (filter n (lambda (x) (even? x))))
(newline)
(print "Odd:")
(print (filter n (lambda (x) (odd? x))))
(newline)))