- Written entirely in Python
- Text-based user interface (achieved using
print()
function or usingturtle
andmatplotlib
library) - Only standard libraries (no
pip install
)
- Based on the Final Fantasy's game of Triple Triads.
- Main objective: win as many cards as possible on a nxn grid.
- Basic Logic:
-
Each player is given
N
poker-cards with 4 values randomly placed on each edge as shown:
where aside from value from
1
to9
, we represent Face Card's values and number 10 asA
for Ace,K
for King,Q
for Queen,J
for Jack,T
for 10. This is to simplify the display formatting. -
Player will take turn to place their cards on a
nxn
(2N > n^2) grid. We use 3x3 grid as example below: -
When a card is placed next to another card, the adjacent values will be used to compare which card is superior. The superior card will win over the inferior card. Whoever owns most card at the end of the game (when the board is filled) will be the winner
-
e.g:
- A
winning choice
for card at cell 8 asQ
(current card) >T
(right neighbor) - A
losing choice
for card at cell 5 (middle):J
(current card) <A
(top neighbor) by 3 points &&4
(current card) <K
(bottom neighbor) by 9 points &&J
(currnet card) >8
(left neighbor) by 3 points so overall there is a net loss of 9 points
- If a move doens't result in winning or losing a card, it is deemed a
normal choice
.
- A
-
Currently, this is a one player game (vs a non-player character
NPC
) with 3 difficulties:EASY
: values are generated from7
toA
MEDIUM
: values are generated from4
to11
HARD
: values are generated from2
to9
you can choose your difficulty level whileNPC
's card is capped atMEDIUM
level
-
- Clone this repository and open jupyter notebook to try out the game.
- Input your name and choose your difficulties:
- Random cards will be distributed to your hand:
- The
coin_toss
function will randomly determines who play first (equal probability). - When it is your turn, you can pick one card from your hand and then choose a position on the board to place:
- After placing your card, the display of the board will be printed on the screen:
- Our logic will then evaluate whether your move is
winning
,losing
ornormal
to change the card owner after every move:
NPC
will randomly place card during his turn.- Continue to play until the whole board is filled.
content
andlogic
are stored in different folders so different teammates can work separately easily.- all functions are kept as modularized as possible.
- hardcodes are minimized so our game can be easily scaled up to bigger board, more cards or more players.