Re: Random from Array

2007-09-16 Thread Michael Dinowitz
I'd do an arraytolist() and do the randrange on the listlen to get the list item (and then delete it). The other way is to do a randrange on the arraylen and keep a list of the empty cells. If the random element is an empty cell, then random again till you get a non-empty one. I prefer the list as

Random from Array

2007-09-16 Thread SMR
Anyone alive this sunday that they could pass me a code snippet since I can't get this correct. I have an array and I want to pull a random number from the array. I only want it to be used one so I then need to delete the value from the array. Array is all numbers. I've tried randrange and rand