{"id":17963821,"url":"https://github.com/pablolion/snarky-hold-em","last_synced_at":"2025-04-03T19:27:25.690Z","repository":{"id":128556358,"uuid":"437562193","full_name":"PabloLION/snarky-hold-em","owner":"PabloLION","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-12T15:13:54.000Z","size":508,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T07:35:58.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PabloLION.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T14:05:30.000Z","updated_at":"2021-12-12T15:13:57.000Z","dependencies_parsed_at":"2023-08-22T02:19:13.786Z","dependency_job_id":null,"html_url":"https://github.com/PabloLION/snarky-hold-em","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PabloLION%2Fsnarky-hold-em","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PabloLION%2Fsnarky-hold-em/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PabloLION%2Fsnarky-hold-em/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PabloLION%2Fsnarky-hold-em/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PabloLION","download_url":"https://codeload.github.com/PabloLION/snarky-hold-em/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247064283,"owners_count":20877577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T11:45:30.268Z","updated_at":"2025-04-03T19:27:25.669Z","avatar_url":"https://github.com/PabloLION.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🃏 for Mina Bootcamp\n\nMy current problems about MINA:\n\n1. Texas Hold'em is a long game. It's better to use multiple files to modularize the process.\n   1. How to call other snapps on chain. Is there a smart contract list that we can use as tool?\n   2. User and server should run different snapps can communicate with each other.\n2. What should stay on-chain. How's the chain only 22KB?\n3. Need more docs on `State\u003cField\u003e`. It seems can only be read once?\n4. How to send message to a specific account? I did Hash(`AccountPublicKey+Message`), but don't know where to post this message. Would be too many things on the chain if we do this every time dealing a card.\n\n## Dev process\n\n### Day 1: Find a game to make\n\n- Considered Civ6, Quarto, Texas Hold'em.\n- Decided to write a Texas Hold'em.\n- Some UI for test. (didn't reach there after 3 days) I think [wallaceturner/crypto-poker](https://github.com/wallaceturner/crypto-poker) is a good. But too complicated to use. It's written with [AureliaJS](https://aurelia.io/)\n- Read again[mitschabaude/snarkyjs-sudoku](https://github.com/mitschabaude/snarkyjs-sudoku)\n- Tried to implement an AI: [wenkesj/holdem](https://github.com/wenkesj/holdem)\n\n### Day 2: UI \u0026 Poker Engine\n\n- Wrote a simple UI myself to show cards from `card_code`\n- Tried to implement some extensions\n  - [rundef/node-poker-odds-calculator](https://github.com/rundef/node-poker-odds-calculator)\n  - [ktseng/holdem_calc](https://github.com/ktseng/holdem_calc)\n- Looked for Poker engine\n  - [goldfire/pokersolver](https://github.com/goldfire/pokersolver)\n  - Didn't use[mjhbell/node-poker](https://github.com/mjhbell/node-poker). Out of date, no NPM.\n  - Didn't use [brunoscopelliti/poker-holdem-engine](https://github.com/brunoscopelliti/poker-holdem-engine), because it's an online API and seems everyone can shuffle the deck.\n- Wrote a part of my poker engine (class `OldDeck`) to encode/decode card deck shuffle deal cards. Other engines don't have a way to encode/decode.\n  \u003e encode refers is a function, which takes the card order of the deck and gives a `BigInt`, decode is its inverse.\n  \u003e It's for saving the deck so to continue later.\n  \u003e On day 3 I found it not needed: just draw a random card from the deck and deal it.\n- Wrote a new deck with a function to show deck like the table below\n\n  | Shown | Meaning          |\n  | ----- | ---------------- |\n  | \"A♣\"  | Ace of Spades    |\n  | \"Q♦\"  | Queen of Hearts  |\n  | \"9♥\"  | Nine of Diamonds |\n  | \"5♠\"  | Five of Clubs    |\n\n- Improve development environment (my tool)\n- SnarkyJS\n  - read [TicTacToe guide](https://o1labs.org/tictactoe)\n  - debug `await this.gameStage.get();` can't use twice, where `gameStage` is a `State\u003cField\u003e` (failed)\n  - Came up with a new way to record the bookkeeping of the game. Charge all user with a `buyIn` then note it down to a `Map\u003cPlayerPublicKey, CreditBalance\u003e`.\n\n### Day 3\n\n- SnarkyJS\n  - Tried(failed) to deal card, as aforementioned \"4. How to send message to a specific account?\"\n  - Tried(failed) to make two snapps, one for user and one for server.\n- Wanted to change the project to TicTacToe with UI and bet.\n  - Started a new repo for TicTacToe and copied the code from [TicTacToe guide](https://o1labs.org/tictactoe).\n  - Reevaluated that I cannot finish it either(in 2h).\n- Git\n  - Fixed detached head\n  - Upload GitHub\n  - Fix typo while writing this doc.\n\n## feature goal\n\n- Timer\n- Show and use bets/buyIn/credits in USD.\n\n## Docs/Contribution\n\n### Name space\n\n#### Poker Game\n\nFrom Hold'em rule\n\n- `startingHand`:First two cards (only the holder can see), known as \"hole cards\" as well\n- `flop`: First three cards\n- `turn`: The fourth card, an additional single card (\"the turn\" or \"fourth street\")\n- `river`: The fifth card, a final card card (\"the river\" or \"fifth street\")\n- Some other names (not used, maybe wrong)\n  - Continuation Bet\n  - Early Position\n  - Continuation-in Part\n  - Flop Turn River\n  - Suited Connectors\n  - Big Bets\n  - Secret Betting Club\n  - Continuation Entries\n  - Set Direct\n  - Fixed Point Continuation\n\nTo use [goldfire/pokersolver](https://github.com/goldfire/pokersolver)\n\n- First uppercase character for number, second lowercase character for suit. See examples below.\n  \"As\": Ace of Spades\n  \"Qh\": Queen of Hearts\n  \"9d\": Nine of Diamonds\n  \"5c\": Five of Clubs\n\n## Thank list\n\n- [Texas hold 'em](https://en.wikipedia.org/wiki/Texas_hold_'em)\n- [wallaceturner](https://github.com/wallaceturner/crypto-poker)\n\n### Special thanks\n\n- [Bo Yao](https://github.com/ailisp) for encouraging me to start this project and the help of [Mental poker](https://en.wikipedia.org/wiki/Mental_poker) model\n\n### MINA questions\n\n- Can I check now many MINA does user have? Or does user have XXX amount of MINA?\n\n## Dev story\n\n- Why do I want to shuffle ? ? ?? ?? ??\n  Truly the status number will be much much fewer w/o shuffle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablolion%2Fsnarky-hold-em","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablolion%2Fsnarky-hold-em","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablolion%2Fsnarky-hold-em/lists"}