GithubHelp home page GithubHelp logo

hwan809 / poker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnnyjayjay/poker

1.0 0.0 0.0 150 KB

An functional implementation of the game mechanics of Texas hold 'em and a Discord bot to play poker in chat

License: Other

Clojure 99.62% Dockerfile 0.38%

poker's Introduction

poker

A Clojure implementation of a poker game (Texas Hold 'em) and a corresponding Discord bot to play poker in chat.

This is (roughly) how the logic part is used:

(require '[poker.logic.game :as poker]
         '[poker.logic.core :as cards])

(def player-budgets {"Alice" 100 "Bob" 85})
(def game (poker/start-game 10 (keys player-budgets) (shuffle cards/deck) player-budgets))

; Available functions
(poker/possible-moves game)
(poker/call game)
(poker/raise game 20)
(poker/fold game)
(poker/all-in game)

Bot

Discord Bots

Here are a few impressions of what it looks like:

The bot is public, you can invite it here.

It is currently not guaranteed to be online 24/7 since some things may still change, but it should be online 99% of the time now.

Running

You are also free to host it yourself (either manually or using Docker):

  1. Get Leiningen (not needed for Docker)

  2. Clone this repo

  3. Put a cofig.clj file in the repo that looks like this:

    {:token           "TOKEN"
    :default-wait-time       25000   ; The default number of milliseconds to wait for players when starting a game
    :default-buy-in  1000    ; The default buy-in if none is specified when running "holdem!"
    :default-timeout         180000} ; The default number of milliseconds after which the current player, if they have not made a move, will fold automatically
  4. Run lein run or docker-compose up

Note that your bot needs to be on the playing cards emoji server for it to work out of the box. I am not the owner of that server, so I can't help with adding your bot there. Please be mindful of the server owner and don't annoy them.
You can also use your own custom emojis. For that, you'll have to modify the emoji ids in poker.discord.display.

License

Copyright © 2020-2021 JohnnyJayJay

This program and the accompanying materials are made available under the terms of the Hippocratic License 2.1 which is available at https://firstdonoharm.dev/version/2/1/license.html

poker's People

Contributors

johnnyjayjay avatar

Stargazers

 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.