Skip to main content

Monopoly Deal simulator

Project description

Monopoly Deal (card game) simulator in python

Quickstart:

% python -m monodeal.game
Player A recieved RentCard[PropertyColour.GREEN|DARKBLUE]
Player B recieved MoneyCard[1]
Player A recieved MoneyCard[1]
Player B recieved PropertyCard[GREEN,'Oxford Street']
Player A recieved MoneyCard[2]
Player B recieved PropertyCard[ORANGE,'Vine Street']
Player A recieved RentCard[PropertyColour.BROWN|PALEBLUE]
...
Player B recieved PropertyCard[STATION,'Liverpool St']
Player B recieved PropertyCard[MAGENTA,'Pall Mall']
Player B has hand [PropertyCard[STATION,'Liverpool St'], PropertyCard[MAGENTA,'Pall Mall']]
Player B has property [
    PS(GREEN,3/3,Oxford Street,Regent Street,Bond Street,-,-), 
    PS(ORANGE,2/3,Vine Street,Bow Street,-,-), 
    PS(STATION,2/4,Fenchurch St,Kings Cross Station,-,-), 
    PS(MAGENTA,2/3,Northumberland Ave,Whitehall,-,-), 
    PS(DARKBLUE,1/2,Mayfair,-,-), 
    PS(PALEBLUE,1/3,Euston Road,-,-), 
    PS(BROWN,2/2,Whitechapel Road,Old Kent Road,-,-), 
    PS(YELLOW,1/3,Leicester Square,-,-), 
    PS(RED,2/3,Strand,Trafalgar Square,-,-), 
    PS(UTILITY,1/2,Electric Company,-,-)])
Player B does action PlayPropertyAction(player=Player B, card=PropertyCard[STATION,'Liverpool St'], colour=<PropertyColour.STATION: 2>)
Player B does action PlayPropertyAction(player=Player B, card=PropertyCard[MAGENTA,'Pall Mall'], colour=<PropertyColour.MAGENTA: 32>)
Player B has won!

Open topics:

  • best discard and payment strategy to meet hand size or payment demand
  • optimise wildcards within property sets
  • scoring and ordering actions

Other work

This is quite OK: https://github.com/brylee123/MonopolyDeal/blob/master/init_deck.py

Thoughts

When a player does an action:

    SkipAction

    PlayMoney(MoneyCard or ActionCard)


    PlayProperty(PropertyCard or WildPropertyCard or RainbowPropertyCard)
        existing propertySet or new
  
    MoveProperty (does not count as one of 3 actions)
        existing propertySet index, property index
        new propertySet index
  
    PlayAction
        card: action card or None
        opponent: player or None
   
    ForcedDeal
        opposing (player, property set, property index)    [not from a complete set]
        your (property set, property index)
    SlyDeal
        opposing (player, property set, property index)    [not from a complete set]
   
    HouseAction
        property set that is complete
    
    HotelAction
        property set complete with house
   
    CollectRainbowRent
      opposing player
      your property set

    CollectRent
       RentCard
       your property set (must match one of two flags on card)

    DebtCollector
    	opposing player

    ItsMyBirthdayAction
        card

    DealBreakerAction
        opposing (player, property set)

    JustSayNo action happens ad-hoc?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monodeal-0.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monodeal-0.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file monodeal-0.0.1.tar.gz.

File metadata

  • Download URL: monodeal-0.0.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for monodeal-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8f33a5bf7ea31251dc7d555b5669559e02fdbf711885832abd4e4f0cd8d48ea9
MD5 f805a08b4b59a48db4a7fe3737906c52
BLAKE2b-256 1d7da3213e6b4008df112b510b890ff457f6fff586fb0c43ec3e63cd65d5befa

See more details on using hashes here.

Provenance

The following attestation bundles were made for monodeal-0.0.1.tar.gz:

Publisher: publish.yml on shuckc/monodeal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monodeal-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: monodeal-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for monodeal-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3448f7ba2b87ebe363a38204095b5f2b10f788f8932841165c36b3a055c9309
MD5 1d25123f77626a89e656b0982a9140b8
BLAKE2b-256 5bf1325469d2f20b2c06398368b471cc507cb5215405b6d1cb21b24bc990bfba

See more details on using hashes here.

Provenance

The following attestation bundles were made for monodeal-0.0.1-py3-none-any.whl:

Publisher: publish.yml on shuckc/monodeal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page