String of Random Numbers

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

String of Random Numbers

Post by Brittgriscom » Tue Jul 05, 2011 12:04 am

How do I randomize a list of numbers between 1 and 9 in which each number occurs once?

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: String of Random Numbers

Post by SparkOut » Tue Jul 05, 2011 12:58 am

Hi Britt, this should do it

Code: Select all

put "1,2,3,4,5,6,7,8,9" into theList
sort items of theList numeric by random(9)
put theList

Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Re: String of Random Numbers

Post by Brittgriscom » Tue Jul 05, 2011 4:09 am

Awesome. Thank you!

Post Reply