Node.js native addon. Use Monte Carlo tree Search to play Hearts.
wiki: https://en.wikipedia.org/wiki/Hearts
-
Cards
- A card is composed of 2 characters.
- The first character indicates the rank: 2~9, T(10), J(J), Q(Q), K(K), A(Ace).
- The second character indicates the suit: H(eart), S(pade), C(lub), D(iamond).
- Example:
- 3H -> 3♥
- TS -> 10♠
- QC -> Q♣
- AD -> A♦
-
Scoring
- ♥[2~9, J, Q, K, A] -1
- ♠Q (QS) -13
- ♣10 (TC): Doubles the score of the player in this deal
- Hearts Exposed:
- When the ♥A (AH) is exposed in a deal, the points of all ♥ cards are doubled in this deal.
- 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'.
- Add the passed cards to other players' cards, so we can know what cards of opponent has.
- Add exposed card.
- Add Hearts broken.
- 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.