## [clisp-list] A few beginner problems

 [clisp-list] A few beginner problems From: Hans3 - 2007-01-21 23:25:34 Hi, Im a LISP beginner and I would like some help. I have 2 problems that might be easy for an advanced programmer: 1. A function which will interpolate the values of 2 lists in a number of steps, so '(1 1 1 1 1) and '(0.5 1 1.5 2 3) would become: ( 1.000 1.000 1.000 1.000 1.000 0.875 1.000 1.125 1.250 1.500 0.750 1.000 1.250 1.500 2.000 0.625 1.000 1.375 1.750 2.500 0.500 1.000 1.500 2.000 3.000 ) How do I make this? 2. A function that returns a list containing integers between sets of lower and upper boundaries. For example: function 20 26 23 28 would return: (20 21 22 23 24 25 26 27 28) Any even number should be possible. 3. A random generator that chooses values form a list or a stackpile without repeating any values until all have been used once. 4. A random generator that chooses values form a list or a stackpile with a specific weight. Example: (weight '(1 2 3) '(4 2 1)) means that 1 has a weight of 4, 2 has a weight of 2 and 3 has a weight of 1, so 1 will be twice as much in a list that 2 and so on. I would grately appreciate if anyone could tell me how to do this, so I can figure out the rest I want to do. Please help me out! Thanks, Hans -- View this message in context: http://www.nabble.com/A-few-beginner-problems-tf3050986.html#a8481115 Sent from the clisp-list mailing list archive at Nabble.com.