randomize only randomizing once --- SOLVED, thanks!

Q&A's, tips, howto's
Locked
joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

randomize only randomizing once --- SOLVED, thanks!

Post by 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:

Code: Select all

#/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:

Code: Select all

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) --
Last edited by joejoe on Thu Oct 01, 2009 6:11 pm, edited 2 times in total.

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Post by joejoe »

newdep wrote:Keep youre eyes on the 'seed's his sister said when they walked through the forest...
Got it!! Thanks newdep!!! :D

Code: Select all

#/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)

Locked