GithubHelp home page GithubHelp logo

poker-monte-carlo's Introduction

Now you are ready to put the whole program together! You have the file
poker.py, which you will use to do the simulations.

In particular, your program should take one or two command line
arguments. The first is required and is the name of the input file to
read. The second is optional and is the number of Monte Carlo trials
to perform. If it is not given, you should use 10,000 as a default
value.

Your main poker.py should:
  - Check command line arguments/report errors.
  - Make a FutureCards and make hands from read_input, passing in the
    filename. 
  - Create a deck with the remaining cards (you just wrote
    build_remaining_deck).
  - Create a list wins to count how many times each hand wins, with
    one more element for if there was a tie (so if there are two
    hands, you should have three elements). Initialize all its values
    to 0. 
  - Do each Monte Carlo trial (repeat num_trials times). Hint: you
    want to abstract this out into a function! 
      o Shuffle the deck of remaining cards
      o Assign unknown cards from the shuffled deck (you just wrote
        future_cards_from_deck)
      o Use compare_hands (from eval.py) to figure out which hand
        won. Note that with potentially more than two hands, this is
	much like finding the max of an array but using compare_hands
	instead of >. If two hands tie, you will need to keep track of
	the second one to compare the best and second best option at
	the end.
      o Increment the win count for the winning hand (or for the
        "ties" element of the list if there was a tie).
  - After you do all your trials, you just need to print your results
    (we provide print_results), as Python will automatically
    deallocate memory and close open files.

poker-monte-carlo's People

Stargazers

 avatar Abhishek avatar

Watchers

Wangwerrr avatar

Forkers

dustinpartain

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.