Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCardHigher ¶
IsCardHigher : Compare 2 card, return true if card 1 number and symbol is higher
Types ¶
type Cangkulan ¶
Cangkulan : Cangkulan The Game Rules
- shuffle deck
- put 1 card from top of deck to table
- give each player 7 cards
- start playing from player 1 (clockwise)
- each player pick one card with the same flag as the card on top of the table, place player card on top of the table
- if player doesnt have card with the same flag draw card from deck until player get the card with the same flag 6.a. if deck doesnt have any more card, draw card from the top of the table
- after all player throw card to the table, compare players card, player with highest number win the round
- continue to play from player who win from last round, player who win last round can choose any card to play first
- repeat 5-9 until one of players doesnt have any more card
type Player ¶
type Player struct { Name string Score float64 LastPlay Card Hand []Card AI bool // false player, true ai }
Player struct
func (Player) ShowHand ¶
func (p Player) ShowHand()
ShowHand : show human readable info of cards in player hand
func (*Player) ThrowCards ¶
ThrowCards : Return card to deck
type SortSymbolNumber ¶
type SortSymbolNumber []Card
SortSymbolNumber : sort card by symbol and number
func (SortSymbolNumber) Len ¶
func (a SortSymbolNumber) Len() int
func (SortSymbolNumber) Less ¶
func (a SortSymbolNumber) Less(i, j int) bool
func (SortSymbolNumber) Swap ¶
func (a SortSymbolNumber) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.