HighDiceRoller / icepool

Python dice probability package.
MIT License
49 stars 5 forks source link

Separable `Deal` hands? #122

Open HighDiceRoller opened 1 year ago

HighDiceRoller commented 1 year ago

Count generation process for two hands:

  1. First hand generates counts. These cards must be removed from the deck before the next step.
  2. Second hand generates counts.
  3. All remaining cards of that outcome are removed. Probably entails separating generate from pop.

Questions:

HighDiceRoller commented 1 year ago

Somewhat ambitious idea:

Potential syntax:

a, b = deck.draw(5, 5)  # a, b are considered to be drawn from the same deck
# probably not mandatory to use them all at the same time
# but if we do another draw it's considered to be from a fresh deck
(a & b).sum()  #  a & b creates an intersection puller, which can then be sent to SumEvaluator()

# but what if:
evaluator.evaluate(a & b, a | b)
# how many hands are pulled, two or four?

# also
evaluator.evaluate(d6.pool(6), d6.pool(6))
# are the pools the same or independent?

Puller interface:

Evaluation:

HighDiceRoller commented 1 year ago

Arguments against:

HighDiceRoller commented 1 year ago

Decided not to pursue this at this time.

HighDiceRoller commented 10 months ago

Thinking about this again. I don't really like the way Deal occupies multiple slots at the moment, and it makes it hard to do things like

a, b = deck.deal(3, 3)
print((a - b).count())

This would require some way of querying the deal for multiple hands at a time.