https://github.com/zionc27/daifugo_game
Daifugō a Japanese card game Rules and playable game
https://github.com/zionc27/daifugo_game
daifugo game python
Last synced: about 1 month ago
JSON representation
Daifugō a Japanese card game Rules and playable game
- Host: GitHub
- URL: https://github.com/zionc27/daifugo_game
- Owner: ZionC27
- Created: 2024-08-02T18:53:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T19:01:30.000Z (9 months ago)
- Last Synced: 2025-01-20T17:48:43.496Z (3 months ago)
- Topics: daifugo, game, python
- Language: Python
- Homepage:
- Size: 6.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 大富豪 Daifugō 🃏♣️♥️♦️♠️
[Daifugō](https://en.wikipedia.org/wiki/Daifug%C5%8D) is a Japanese card game usually played on school trips, at parties, or when drinking.
The rules vary from person or region. For example, I usually play without 9(reverse) and I have also played with the rule 99([救急車](https://boku-boardgame.net/cards/daifugou-99-66/)) where you play 2 9s to get the same function of 8(切り).
The game is similar to the game [Big two](https://en.wikipedia.org/wiki/Big_two) usually played in Taiwan, Hong Kong and China.## Daifugou Card Game Rules (English)
**Daifugou (大富豪)** is a popular Japanese card game that emphasizes strategic card play and a little bit of luck. Here's how to play:
### Game Objective
Be the first player to get rid of all your cards!
### Players
* 2-6 players
### Card Ranking (High to Low)
* **2 > A > K > Q > J > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3**
### Game Setup
1. **Dealing:** Deal the cards evenly among all players. Any remaining cards become the "draw pile."
2. **First Player:** The player with the lowest card starts the first round. Play then continues clockwise.### Gameplay
1. **Turns:** On your turn, you can play a valid card combination or pass.
2. **Card Combinations:**
* **Singles:** Play any single card.
* **Pairs:** Play two cards of the same rank.
* **Triples:** Play three cards of the same rank.
* **Straights:** Play three or more consecutively ranked cards (suits don't matter). Aces can be high or low but not both (K-A-2 is invalid).
3. **Beating Cards:**
* **Higher Card:** To play on a previous hand, your card(s) must be of the same type (single, pair, etc.) AND higher in rank.### Special Rules
Daifugou gets extra exciting with these optional rules:
* **5 Skip (5スキップ):** A 5 skips the next player in turn.
* **7 Pass (7渡し):** A 7 lets you choose any card in your hand to give to the next person. You can give up to the number of 7s you played or none.
* **8 Cut (8切り):** An 8 played alone forces everyone to pass, clearing the table and giving you the lead for the next round.
* **10 Discard (10捨て):** Playing a 10 allows you to discard one card from your hand. That card is out of the game. You can discard up to the number of 10s you played or none.
* **9 Reverse (9リバース):** This reverses the ranking of cards 2 smallest and 3 biggest until the end of the turn
* **11 Back (11バック):** Playing a Jack (J) reverses the ranking of cards 2 smallest and 3 biggest.
* **Revolution (革命):** **four of a kind** This triggers a "Revolution" This reverses the ranking of cards 2 smallest and 3 biggest until the game ends or until the next revolution is played**Combining Special Rules:** Yes, you can! Playing a pair of 8s, for instance, would trigger an 8 Cut.
### Winning and Losing
* **President (大富豪 - Daifugou):** The first player to empty their hand wins the round and earns the prestigious title of "President."
* **Pauper (大貧民 - Daihinmin):** The last player with cards remaining becomes the "Pauper" for the round.### Revolution!
When a 2 or a combination of 2s, or **four of a kind is played, it signifies a **Revolution (革命)**. The card ranking hierarchy is temporarily flipped!
* **During a Revolution:** 3s become the highest rank, and 2s become the lowest.
* **Ending a Revolution:** Another 2 or combination of 2s, or **four of a kind** needs to be played to revert the ranking back to normal.### Have Fun!
Daifugou is a game of strategy, observation, and a bit of luck. Enjoy the game and let the revolutions begin!
## 大富豪のルール
### ゲームの目的
最初にすべての手札をなくしたプレイヤーの勝ちです!
### プレイヤー数
* 2~6人
### カードの強さ (強い順)
* **2 > A > K > Q > J > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3**
### ゲームの準備
1. **カードを配る:** 全員に均等にカードを配ります。残ったカードは「山札」になります。
2. **最初のプレイヤー:** 最も弱いカードを持っているプレイヤーが最初のラウンドを開始します。その後、プレイは時計回りに進みます。### ゲームプレイ
1. **ターン:** 自分のターンでは、有効なカードの組み合わせを出すか、パスすることができます。
2. **カードの組み合わせ:**
* **シングル:** 好きなカードを1枚出します。
* **ペア:** 同じ数字のカードを2枚出します。
* **スリーカード:** 同じ数字のカードを3枚出します。
* **ストレート:** 数字が連続するカードを3枚以上出します(スートは関係ありません)。Aは強いカードとしても、弱いカードとしても使えますが、両方はできません(K-A-2は無効です)。
3. **カードを強める:**
* **強いカード:** 前に出されたカードよりも強いカードを出すには、同じ枚数で、かつ、強いカードである必要があります。
* **革命 (かくめい):** 2(単独または任意の組み合わせ)または **フォー・オブ・ア・カインド(ペア2組)** は、他のどのカードまたは組み合わせよりも自動的に強くなります。これにより、「革命」が起きます!### 特別ルール
大富豪は、以下のオプションルールを加えることで、さらにエキサイティングになります。
* **5スキップ (ごスキップ):** 5を出すと、次のプレイヤーの順番を飛ばすことができます。
* **7渡し (ななわたし):** 7を出すと、自分の手札から1枚のカードを選んで、次のプレイヤーに渡すことができます。出した7の枚数分だけ渡すことができますが、渡さなくてもかまいません。
* **8切り (はちぎり):** 8を単独で出すと、全員がパスになり、場が流れます。次のラウンドは、8を出したプレイヤーがリードします。
* **9リバース:** 9をダスト、ターンの回る順番が逆になります。
* **10捨て (じゅうすて):** 10を出すと、手札から1枚を裏向きに捨て札にすることができます。捨て札にしたカードはゲームから除外されます。出した10の枚数分だけ捨てることができますが、捨てなくてもかまいません。
* **11バック (じゅういちバック):** J (ジャック) を出すと、カードの強さが逆になり、2が一番弱く、3が一番強くなります。
* **革命 (かくめい):** ** 4枚のペアを出す** これにより、「革命」が起きます。ゲームが終了するか、次の革命が起こるまで、カードの強さが逆になり、2が一番弱く、3が一番強くなります。**特別ルールの組み合わせ:** 可能です!例えば、8のペアを出した場合、8切りが発動します。
### 勝敗
* **大富豪 (だいふごう):** 最初に手札をなくしたプレイヤーがラウンドの勝利となり、「大富豪」の称号を得ます。
* **大貧民 (だいひんみん):** 最後にカードが残ったプレイヤーは、ラウンドの「大貧民」となります。### 革命!
2または2の組み合わせ、または**フォー・オブ・ア・カインドが出されると、「革命(かくめい)」が起こります。カードの強さの順位が一時的に逆転します!
* **革命中:** 3が最も強く、2が最も弱くなります。
* **革命の終了:** もう一度2または2の組み合わせ、または**フォー・オブ・ア・カインド**が出されると、元の強さに戻ります。### 楽しんで!
大富豪は、戦略、観察力、そして少しの運が試されるゲームです。ゲームを楽しんで、革命を起こしましょう!
## How to play
1. Download [Python](https://www.python.org/downloads/) on your device
2. Download the main.exe file
3. Play!## Feel free to play around with the code
**main_exe.py** is the version where AI player cards and moves are not displayed.
**main_playable.py** is the version where AI player cards and moves are displayed.## TODO
- **Use an Evolutionary Algorithm to find the best moves**
- **Design better AI** Right now if Joker is in the AI's hand it will always be played to win the earliest hand but it should be used in for the best situation to win