Skip to content

Commit 6ef1c44

Browse files
committed
updated README, include README in rustdoc
1 parent 4a2ebe1 commit 6ef1c44

File tree

2 files changed

+62
-19
lines changed

2 files changed

+62
-19
lines changed

README.md

+60-19
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,81 @@
11
# Big Two
22

3-
## Game Loop
3+
[A card game of Cantonese origin](https://en.wikipedia.org/wiki/Big_two), played by children
4+
and adults alike across the world, with nothing more than a Standard 52 Card Deck.
45

5-
### Assumptions
6-
- 52 standard playing cards
7-
- 4 Players, start with 13 cards each
8-
- First player to have 0 cards wins
6+
## Game Rules
7+
8+
Please keep in mind, Big Two has many variations, this is merely one interpretation.
9+
10+
### Objective
11+
- Take turns playing cards, following the rules for valid combos
12+
- First player to have 0 cards wins!
913

1014
### Initialization
1115

1216
- 52 Shuffled Cards dealt to 4 Players, 13 each
13-
- Player who has the Three of Clubs [3C] is first
17+
- Player who has the Three of Clubs is first
1418

1519
### Starting a Trick
1620

17-
- [First Trick Only] Player with the Three of Clubs starts, they must play a valid hand that contains the Three of Clubs.
18-
- [All Other Tricks] Player who won the previous Trick gets to start, with any valid hand that they can make with their hand.
21+
- **First Trick Only**: Player with the Three of Clubs starts, they must play a valid hand that contains the Three of Clubs.
22+
- **All Other Tricks**: Player who won the previous Trick gets to start, with any valid hand that they can make with their hand.
1923
- Next Player is Counter-Clockwise.
2024

2125
### Trick Loop
2226

2327
- Current Player either:
24-
- Plays a valid hand from their cards, that "beats" (highest card of played hand is higher than highest card of previous hand).
25-
- If these are the Player's last cards, Gamw Over and Player Wins.
26-
- Passes, plays no cards and exits the Trick.
27-
- If this is the 3rd player to Exit the Trick, i.e. there is only one other player remaining in the Trick, then the Trick is over, last remaining player in Trick wins the Trick
28+
- Plays a valid hand from their cards, that ["beats"](#comparing-hands) the previously played hand.
29+
- If these are the Player's last cards, Gamw Over and Player Wins.
30+
- Passes, plays no cards and exits the Trick.
31+
- If this is the 3rd player to Exit the Trick, i.e. there is only one other player remaining in the Trick, then the Trick is over, last remaining player in Trick wins the Trick
2832
- Counter-Clockwise to next Player (who has not already passed).
2933

34+
### Valid Hands
35+
36+
The following are the possuble valid hands, in increasing order of rareness and value.
37+
38+
- Lones (aka Singles, High Card): Just a single Card.
39+
- Pairs (aka Dubs, Two-Of-A-Kind): Two Cards of the same Rank.
40+
- Trips (aka Three-Of-A-Kind): Three Cards of the same Rank.
41+
- (TODO) Fivers (aka Five Card hands):
42+
- Straight: each Card in the Hand is of consecutive Rank from the previous Card in the Hand.
43+
- Flush: all 5 Cards are the same Suit.
44+
- Full-House: a Pair and a Trip.
45+
- Four-Of-A-Kind-Plus-Kicker: 4 cards of the same Rank, plus any arbitrary additional card.
46+
- Straigh-Flush: both a Straight and a Flush at the same time.
47+
- (TODO) Bombs
48+
- Bombs are special combos that may be played on anything except Lones.
49+
- i.e. They are not restricted to only being played on Hands of the same number of Cards.
50+
51+
### Comparing Hands
52+
53+
When playing a Hand after another player, the incoming Hand must "beat" the previous Hand.
54+
55+
Rank always takes precedence to Suit! E.g. a Seven of Clubs beats a Six of Spades.
56+
57+
- Lones can only be beaten by higher Lones.
58+
- Bombs CAN NOT be played upon Lones.
59+
- Pairs can only be beaten by higher Pairs or Bombs.
60+
- Trups can only be beaten by higher Trips or Bombs.
61+
- Fivers can be beaten by higher Fivers or Bombs.
62+
- Between any two different types of Fivers, the higher type always wins.
63+
- i.e. any Straigh-Flush beats every Four-Of-A-Kind-Plus-Kicker, and so on.
64+
- between Straights, compare the highest card in each (Rank first, then Suit).
65+
- between Flushes, compare the Rank of the highest card in each.
66+
- between Full-Houses, compare the Rank of the Trips.
67+
- Pairs Rank is disregarded.
68+
- Between Four-Of-A-Kind-Plus-Kicker, compare Rank of the Four-Of-A-Kind.
69+
- Kicker's Rank is disregarded.
70+
- Between Straigh-Flushes, compare the highest card in each (Rank first, then Suit).
71+
3072
## Current Game Limitations (i.e. TODOs)
3173
- Only supports Lone, Pairs, and Trips
32-
- Need to implement Fivers: Straight, Flush, FourPlusKick, StraightFlush
33-
- Need to implement Bombs
74+
- Need to implement Fivers: Straight, Flush, FourPlusKick, StraightFlush
75+
- Need to implement Bombs
3476
- NPC AI only plays Lone, will pass on Pairs and Trips
35-
- Need to implement AI that can play on anything
36-
37-
## Current Code Organization Issues
38-
- main contains the logis to initialize the game and run Tricks
39-
- Need to make a Game module and relocate this logic (shuffle deck, deal cards, find player with 3C)
77+
- Need to implement AI that can play on anything
78+
- Currently only Single-Player
79+
- Need to implement Local Multiplayer (pass the keyboard style).
80+
- Need to implement Cloud Multiplayer ("jackbox style", room with a code).
4081

src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[doc = include_str!("../README.md")]
2+
13
mod card;
24
mod constants;
35
mod deck;

0 commit comments

Comments
 (0)