Code Monkey home page Code Monkey logo

monopoly's Introduction

main.py

  • Run the game with 200 turns and 4 players
  • Options can be modified in this file

test_probabilities.py

  • Runs a game with one player and a million dice rolls
  • Prints the probabilities of ending a turn on each spot
  • Graphical representation (chart.js):

Decisions

  • Buys a property that has been landed on when one of these two requirements is met:
    • Player has over £600
    • Player has over double the cost of the property
  • Building houses and hotels (check every turn):
    • Needs to be in a complete set (All cards in the set are owned by this player)
    • If the property has 0 houses,
      • Build 3 houses or fewer if there are less left in the bank and the player will have at least £200 left after building
    • If the property has houses,
      • Build a hotel if there's one in the bank and the player will have at least £200 left after building
  • If the player is in jail, they will always use any existing get out of jail free cards first
    • If the player doesn't have any, but the player has over $150, the player will pay $50 to get out of jail
    • Otherwise, the player will wait out the three turns

TBD

  • Add chance cards: street repairs, general repairs, birthday
  • Trading?

monopoly's People

Contributors

sank6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.