GithubHelp home page GithubHelp logo

samwez / bigtwo-discord-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ortiane/bigtwo-discord-bot

0.0 0.0 0.0 417 KB

A simple Discord bot which allow members to play Big Two card game

Python 99.90% Batchfile 0.05% Shell 0.05%

bigtwo-discord-bot's Introduction

BigTwoBot for Discord

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

Project need to be tested

I have done the first release of this bot. However, it's not tested yet. Some fatal bugs might exists.

Combo detection logic

The ranking for suit and rank of the card is recorded in a .json file.

Straight

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.

Flush

Iterate throught all input cards. If any of the suit of card number i and card number i + 1 is not match, return false.

Royal Flush

Straight and Flush

Full House

Group all input cards by rank. Return true if there is only 2 groups and the largest group contain 3 cards.

Four of a Kind

Group all input cards by rank. Return true if there is only 2 groups and the largest group contain 4 cards.

Combo Comparison

Combo ranking

  1. Royal Flush
  2. Four of a Kind
  3. Full House
  4. Flush
  5. Straight

Leading card

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.

Suit first, rank second

For Flush and Royal Flush, must compare suit of the group first, then the largest card.

bigtwo-discord-bot's People

Contributors

tajam avatar alan13519 avatar ortiane 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.