Search found 8 matches
- Sun Aug 26, 2012 12:42 am
- Forum: Homework
- Topic: Random function
- Replies: 2
- Views: 8149
Random function
Hi everyone . I want to make an array inside a struct and randomly generate initial states.
Re: cons
tnx everyone . I created this instruction , but this is very confusing
(cons 1 (cons (cons 2 (cons 6 (cons 7 (cons 8 ()))))(cons 3 ( cons (cons 4 (cons 9 (cons (cons 12())())))(cons(cons 5(cons 10 (cons 11()))) ())))))
(1 (2 6 7 8) 3 (4 9 (12)) (5 10 11))
(cons 1 (cons (cons 2 (cons 6 (cons 7 (cons 8 ()))))(cons 3 ( cons (cons 4 (cons 9 (cons (cons 12())())))(cons(cons 5(cons 10 (cons 11()))) ())))))
(1 (2 6 7 8) 3 (4 9 (12)) (5 10 11))
- Mon Jul 23, 2012 2:31 am
- Forum: Homework
- Topic: Tree and linked list in lisp
- Replies: 2
- Views: 8225
Tree and linked list in lisp
Hi every one . I'm beginner in lisp and I need a references about how to build data structure like tree or graph and implement search like breadth first search .
Can any one tell me good Reference
tnx
Can any one tell me good Reference
tnx
Re: cons
tnx . i found how to build a nested list
cons
Hi every . i have question about cons in lisp . how can i make this list
(1 (4 9 (12) ))
i used this rule (cons 1 (cons (cons 4 (cons 9 (cons (cons 12()))) ()) ())) but interpreter return error
(1 (4 9 (12) ))
i used this rule (cons 1 (cons (cons 4 (cons 9 (cons (cons 12()))) ()) ())) but interpreter return error
- Sat Jul 14, 2012 2:16 am
- Forum: Homework
- Topic: String + 1
- Replies: 1
- Views: 7265
String + 1
Hi everyone . i need to write a function in lisp that receive string and then add 1 to each characters. for example "2a6c12" and then return "3b7d23". i write this function (defun my-list(f) (loop for x across f collect(code-char(+ 1 (char-code x))))) but my output like this (#\3...
- Sat Jul 14, 2012 12:12 am
- Forum: Homework
- Topic: counts number in a list
- Replies: 3
- Views: 10185
Re: counts number in a list
Tnxxxxxxxxxxxxxxxxxxxxxxxx
- Thu Jul 12, 2012 7:44 am
- Forum: Homework
- Topic: counts number in a list
- Replies: 3
- Views: 10185
counts number in a list
Hi every one
I need a function count numbers in a list for example
(count-numbers '(3 4 5 a b c d 6 ) ) -> 4
I need a function count numbers in a list for example
(count-numbers '(3 4 5 a b c d 6 ) ) -> 4