Skip to content

Node.js native addon. Use Monte Carlo tree Search and Monte Carlo method to play Hearts.

License

Notifications You must be signed in to change notification settings

Heatwave/node-hearts-mcts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-hearts-mcts

Node.js native addon. Use Monte Carlo tree Search to play Hearts.

Hearts game rules

wiki: https://en.wikipedia.org/wiki/Hearts

Terminology

  1. Cards

    1. A card is composed of 2 characters.
    2. The first character indicates the rank: 2~9, T(10), J(J), Q(Q), K(K), A(Ace).
    3. The second character indicates the suit: H(eart), S(pade), C(lub), D(iamond).
    4. Example:
      • 3H -> 3♥
      • TS -> 10♠
      • QC -> Q♣
      • AD -> A♦
  2. Scoring

    1. ♥[2~9, J, Q, K, A] -1
    2. ♠Q (QS) -13

special rules:

  1. ♣10 (TC): Doubles the score of the player in this deal
  2. Hearts Exposed:
    1. When the ♥A (AH) is exposed in a deal, the points of all ♥ cards are doubled in this deal.

TODO

  1. Use Monte Carlo simulation to rollout games to get the Shooting the Moon rate, to adjust passed cards, exposed card and MCTS Shooting the Moon 'wins'.
  2. Add the passed cards to other players' cards, so we can know what cards of opponent has.
  3. Add exposed card.
  4. Add Hearts broken.
  5. If one of the players pick a card it's not the played suit, we can know he/her has no the cards with that suit.

References

  1. http://mcts.ai/

About

Node.js native addon. Use Monte Carlo tree Search and Monte Carlo method to play Hearts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published