Search found 2 matches

by HomuciferMadokami
Tue Nov 26, 2013 7:32 am
Forum: Homework
Topic: just a basic for beginner.
Replies: 1
Views: 7648

just a basic for beginner.

Code: Select all

(defun op(n)
	(nth (mod n 3) '(+ - *))
)
(defun pre-op(n)
	(nth (mod n 4) '(sqrt sin log))
)
(defun const(n)
	(nth (mod n 11) '(0.1 1 2 3 4 5 6 7 8 9))
)
(defun main()
	((op 0) 3 2)
)
(main)
how do I make it become (+ 3 2)
by HomuciferMadokami
Tue Nov 26, 2013 7:24 am
Forum: Homework
Topic: basic, but I don't understand
Replies: 1
Views: 7164

basic, but I don't understand

Code: Select all

(defun op(n)
	(nth (mod n 3) '(+ - *))
)
(defun pre-op(n)
	(nth (mod n 4) '(sqrt sin log))
)
(defun const(n)
	(nth (mod n 11) '(0.1 1 2 3 4 5 6 7 8 9))
)
((op 0) 3 2)
so I have that code, and I'm expecting the
so uh, how to make the ((op 0) 3 2)
become (+ 3 2)