EvgenyPetrovsky / haskell-gymnastics

short exercises for having practice with Haskell
0 stars 0 forks source link

define roulette structure #5

Closed EvgenyPetrovsky closed 6 years ago

EvgenyPetrovsky commented 6 years ago

Project should consist of modules

strategy should have access to necessary data in a generic way. first think which classes are implemented by what modules. Where Player should be? Where player actions should be implemented?

EvgenyPetrovsky commented 6 years ago

Player should stay in game because game defines what player is and what she can do

EvgenyPetrovsky commented 6 years ago

We need to think in use cases. Someone (person) who has money goes to casino and joins the game table (that also defines roulette style). So this is player. Player faces series of roulette spins' outcomes and applies her strategy to win. Player is playing for fixed time (measured by number of spins) and uses limited amount of money it has. Game stops when time is over or if player runs out of her money. Player plays fair game where winning number doesn't depend on stakes made.

EvgenyPetrovsky commented 6 years ago

Here is understanding (on resolution date)

Building blocks

solution consists of 3 parts:

  1. game defined separately
  2. simulation framework defined separately; it is strategy agnostic
  3. strategies defined separately

who is Player

Player is a person with balance, experience (of previous games), luck (defines random generation) and game she is involved in. Player is part of game (1.) definitions.

what is Strategy

Strategy is a response of player represented in a set of Bets she does based on her balance and existing experience. Player has luck but no has idea on how to use it.

what is Simulation

Simulation is framework that generates players and runs series of games. Simulation applies given strategies for series.