I'd like to see a shuffling algorithm that's more realistic.
perhaps something like:
deck= (array of cards in deck)
no_cards= (total no of cards in deck)
shuffle(deck) {
count cards in deck
split deck in half
{a-----------------------------------------z}
{a--------------------|--------------------z}
make it into two different arrays
tmp_deck1{a-------------------m}
tmp_deck2{n-------------------z}
pick a random number of set [1-3]
# what the above line is doing is imitating how many
# cards will fall from one side of the deck into the
# completed deck (the middle joining) when doing
# a physical shuffle. we'll repeat it with the other half
# but using a different number. it could be anywhere
# from 1 - 5, but in the interests of simplicity and more
# shuffling, i'm suggesting 3.
move that many spaces into tmp_deck1
inserting all before tmp_deck1[rand(3)] into
shuffled_deck[]
switch to tmp_deck2 and pick again
fingers=rand(3)
for each of fingers
move tmp_deck2[fingers] > shuffled_deck
loop above algorithm until either tmp_deck is empty
or shuffled_deck is full
return shuffled_deck
}
then call with something like:
shuffle('aether.dec')
shuffle(deck_variable)
i hope the message that i'm trying to get across is clear. i'm
sure that a /dev/random shuffle works. but i'd like to see a
little bit more realistic so that i can see how things will
actually work.
on another note, when i get done playing a game, what i
do is shuffle my graveyard, hand, and all cards in play with
the land and then shuffle that stack back into the library.
graveyard \
hand - land -- library
in play /
maybe you could incorporate something like that into the
algorithm.
shuffle(library,shuffle(land_in_play,shuffle(graveyard,hand)))
if you have any questions about what i'm talking about feel
free to write me at madbogart@yahoo.com.
-tMB
ps: i'll see if i can't write out some workable code to show
you what i'm thinking about. i'll post again if i get
anywhere..
Logged In: NO
-tMB here.. got it.
if anyone reading this would like to see what i got, drop me a line at
madbogart@yahoo and i'll give you a copy.