GithubHelp home page GithubHelp logo

blackjack's Introduction

A program that learns to play "Blackjack"

A program that learns to play a variant of the card game "Blackjack" in the same way as the AlphaZero program.

Game

  • Two players alternately roll dice, and keep track of their total across turns.
  • They are each trying to reach a sum that lies in a specified target, between a fixed low value and high value.
  • If a player reaches a score in the target range, they immediately win; If they exceed the high value, they immediately lose.
  • The players can choose the number of dice to roll on each turn, between 1 and a fixed maximum.

Usage

usage: BlackJack.py [-h] -d D -s S -l L -u U -m M -n N

A program learns to play Blackjack

optional arguments:
-h, --help  show this help message and exit
-d D        the number of dices
-s S        the number of sides each dice
-l L        the lower bound of winning
-u U        the upper bound of winning
-m M        the hyperparameter
-n N        the number of times to play

Example

  • Input: python BlackJack.py -d 2 -s 3 -l 6 -u 7 -m 100 -n 100000
  • Output: the correct number of dice to roll in each state and the corresponding probability. See output.txt.

blackjack's People

Contributors

junxiao-zhao 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.