Question 6 Deck Card Shuffling In Access

in terms of what you asre trying to - its trivial to a cpu

lets say you have a string of 624 characters (312 cards with 2 chars for each)

then the nth card is given simply by

mid(cardstring,(2n-1),2)
 
Cool! I can see how that would do exactly what I want to do.

Would that be executable through a query so that the number can recreate the shoe in one step, or do I have to execute it in 312 separate steps?
 
i think if you wanted to have it on tap, it would be better to store the cards in an array - so not a query, just a function to populate the array

this sort of thing, but you probably need some error checking as well

so given a cardstring

dim x as long
dim cardarray(312) of sometype (actually decalre this public in a module)

for x = 1 to 312
cardarray(x) = mid(cardstring(2x-1,2)
next

although you dont actually have to do this - unless you want to see the sequence visually in some way - since you can just extract each card as you need it.
 

Users who are viewing this thread

Back
Top Bottom