Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
randomizing print statements w/arrays
#11
the next post was short and i don't like posting spam
Reply
#12
I had been thinking about SWAP for a little bit now, and I came up with a simple solution:

Code:
RANDOMIZE TIMER
DIM array(3 to 6)
array(3) = "whatever"
array(4) = "boo"
array(5) = "Seph is kickass"
array(6) = "rocking horses"

FOR i% = 1 TO shuffleamount%
    i% = INT(RND * UBOUND(array)) + LBOUND(array) - 1
    SWAP array(i%), array(i% + 1)
NEXT i%

There, no repetition.
earn.
Reply
#13
Quote:the next post was short and i don't like posting spam

Heh, talk about your contradictions Wink
earn.
Reply
#14
I aplaud people who use the edit button... it's what it's there for, so I don't have to scroll down through short sentences that mean little to me Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)