In this case, I was trying to pull 1 card from a 5-card pool, which
should have worked. There was a typo in my code that I have since
fixed, and it is working.
I have to make sure manually that I'm not telling the program to pick
more cards than exist in the list. I can do this two ways: Ma
I shouldn't get the same card twice in the same batch, no.
Of course, in separate trials, I may get the same card again.
Basically, I type the names of relevant cards in a list, and proceed
to "tell" my program which list to read, and how many cards to pick
from that list.
Normally, I put e
Bob, Kent,
I understood all that from the context and yet do not feel familiar
enough with the information nor had the time to lookup.
The point I'm making is that Alan has a logical problem with his
generator regarding the question of repetitive cards in a booster:
On one hand, the script does n
OmerT wrote:
I'm unfamiliar with the random.sample function, yet I can't help but wonder:
Do you ever got the same card twice?
Quoting the manual:
sample( population, k)
Return a k length list of unique elements chosen from the population
sequence. Used for random sampling without replaceme
I'm unfamiliar with the random.sample function, yet I can't help but wonder:
Do you ever got the same card twice?
Is that intentional ?
On Thu, Aug 28, 2008 at 6:29 PM, Alan Gilfoy <[EMAIL PROTECTED]> wrote:
> Quoting W W <[EMAIL PROTECTED]>:
>
>
>>> The number of items I want from a list is sma
Quoting W W <[EMAIL PROTECTED]>:
The number of items I want from a list is smaller than the population
(number of items) in the list, so it should work.
In this specific case, I'm asking for one item from a five-item list.
Are you sure?
change this:
for card in random.sample(SpecialA, SA):
On Thu, Aug 28, 2008 at 1:33 AM, Alan Gilfoy <[EMAIL PROTECTED]>wrote:
>
> The number of items I want from a list is smaller than the population
> (number of items) in the list, so it should work.
>
> In this specific case, I'm asking for one item from a five-item list.
Are you sure?
change thi
One of my for-fun Python products is a booster-pack generator for
trading card games (specifically, Magic the Gathering, the one game of
the genre that I play heavily)
Somewhat like baseball cards, the cards in a pack are a
somewhat-random selection of cards from the set in question, broken