randomize only randomizing once --- SOLVED, thanks!

Started by joejoe, October 01, 2009, 10:49:43 AM

Previous topic - Next topic

joejoe

Hi -



When I run my go.lsp file repeatedly from the command line, I am getting the same output every time. Here is the go.lsp:


#/usr/bin/newlisp

; read the input file

(set 'l (read-file "./list"))

; parse and print the inputed, randomized file

(set 'r (randomize (parse l)))
(println r)

(exit)


$ newlisp go.lsp

("nine" "five" "one" "three" "ten" "six" "eight" "two" "four" "seven")

$ newlisp go.lsp

("nine" "five" "one" "three" "ten" "six" "eight" "two" "four" "seven")



The file list looks like this:


one
two
three
four
five
six
seven
eight
nine
ten


I am trying to get it to display a different, randomized output every time.



Thanks for any hint. :0)   --

newdep

#1
Keep youre eyes on the 'seed's his sister said when they walked through the forest...
-- (define? (Cornflakes))

joejoe

#2
Quote from: "newdep"Keep youre eyes on the 'seed's his sister said when they walked through the forest...


Got it!! Thanks newdep!!! :D


#/usr/bin/newlisp

; read the input file

(set 'l (read-file "./list"))

; parse and print the inputed, randomized file

(seed (date-value))
(set 'r (randomize (parse l)))
(println r)

(exit)