Forked from Tajam/bigtwo-discord-bot.
A simple Discord bot which allow members to play Big Two card game in each channel.
Made from scratch using discord.py
I have done the first release of this bot. However, it's not tested yet. Some fatal bugs might exists.
The ranking for suit and rank of the card is recorded in a .json file.
Iterate throught all input cards. If the rank of the card number i + 1 is next rank of card number i, add 1 to valid point. Return true if there is 4 valid points.
Iterate throught all input cards. If any of the suit of card number i and card number i + 1 is not match, return false.
Straight and Flush
Group all input cards by rank. Return true if there is only 2 groups and the largest group contain 3 cards.
Group all input cards by rank. Return true if there is only 2 groups and the largest group contain 4 cards.
- Royal Flush
- Four of a Kind
- Full House
- Flush
- Straight
For Straight, Full House and Four of a Kind, just compare the largest card in the group. Same logic used for Double and Triple combo.
For Flush and Royal Flush, must compare suit of the group first, then the largest card.