Search found 5 matches
- Wed Jun 03, 2009 5:35 pm
- Forum: Common Lisp
- Topic: Combining digits to make a string
- Replies: 18
- Views: 27286
Re: Combining digits to make a string
(make-array (length some-list) :initial-contents some-list) (let ((array (make-array number-seeds))) (dotimes (num number-seeds value) (setf (aref array num) (list (random 3) (random 3) (random 3))))) I could not get either of those options working, but i think that it was my fault, as I have alrea...
- Tue Jun 02, 2009 5:04 pm
- Forum: Common Lisp
- Topic: Combining digits to make a string
- Replies: 18
- Views: 27286
Re: Combining digits to make a string
I decided to use this code: (setq number-seeds 10) (let (value) (dotimes (num number-seeds value) (setq value (cons (list (random 3) (random 3) (random 3)) value)))) I get a list of: ((. . .) (. . .) ...) Is there a way to turn the list into a vector such as: [(. . .) (. . .) ...] or a different way...
- Mon Jun 01, 2009 11:46 pm
- Forum: Common Lisp
- Topic: Combining digits to make a string
- Replies: 18
- Views: 27286
Re: Combining digits to make a string
Maybe if I explain why I want these numbers (or strings I'm not sure what to call them) it might clear up the confusion. Like I said I am new at this, but I want to make a GA (genetic algorithm) using a representation of DNA instead of using binary for my population. I was wondering what is the best...
- Tue May 26, 2009 7:38 pm
- Forum: Common Lisp
- Topic: Genetic Algorithm
- Replies: 4
- Views: 10603
Genetic Algorithm
I am extremely new to lisp but I heard it is good for making genetic algorithms or programs. I am trying to write a genetic algorithm in lisp, I had attempted it in AHK (autohotkey) if you know what that is, but I hit a road block and it took forever. I want the basis of my algorithm to act like thi...
- Tue May 26, 2009 7:09 pm
- Forum: Common Lisp
- Topic: Combining digits to make a string
- Replies: 18
- Views: 27286
Combining digits to make a string
Warning: I am completely new to lisp, I started two days ago. What I want to do is make a 3 digit number, randomly generated and each number can only range from 0 to 3 ex: '301' '123' '000' '333' ... They way I was trying to do it was use the random funcion (random 3) then append all three of the di...