[opensource] Random seed

BRIAN SWANEY swaney.29 at osu.edu
Mon Mar 19 18:51:27 EDT 2007


I am working on a Java code that shuffles a deck of Yu-Gi-Oh cards (a rather complicated game; see https://www.upperdeckentertainment.com/yugioh/en/gameplay/rulebook/rulebook_v06_EN.pdf for details on the rules), and have mostly formatted the display of cards by now, but cannot shuffle the deck. I probably don't understand the random seed syntax.

My algorithm involves listing cards from 1 to 40, randomly selecting a card from that list, copying it in sequence onto a second list, then blanking out the previous card position to note that it was already taken. It seems that no matter what I enter as the seed, it doesn't go through all the cards and only repeats things that it already took (like 32 to 35 out of 40 cards). Can anyone with a bit of spare time and acceptance of newbies look it over and give me some (appreciated) advice?

PS - Sorry that the methods are not too organized...

-Brian Swaney

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Yu-Gi-Oh_Source.tar
Type: application/x-tar
Size: 51200 bytes
Desc: not available
Url : http://mail.cse.ohio-state.edu/mailman/private/opensource/attachments/20070319/7c469d2b/Yu-Gi-Oh_Source-0001.tar


More information about the Opensource mailing list