Pishti

Pishti is a Java class library which allows you to write and test player strategies for the "Pişti" card game.

Table of Contents

About Pişti card game

Pişti is a Turkish card game which is played with a pile of 52 cards and usually with four players. The direction of play is anticlockwise. Cards are played to a central stack, which can be captured by matching the previous card played or playing a jack. Points are scored for certain captured cards. The word "pişti", which means "cooked", describes a capture of a pile containing only one card, for which extra points are scored. The dealer deals the top four cards face down to the centre of the table, and then a packet of four cards to each player, beginning to dealer's right and ending with the dealer. The card on the top of the four closed cards on the table is turned face up to start the game. The player to dealer's right begins, and the turn to play passes anticlockwise. A turn consists of playing one card from your hand face up on top of the discard pile. If rank of the played card matches the rank of the previous card on the pile, the player captures the whole pile. The next player will then start a new stack by playing a card face up to the empty table. Playing a jack also captures the whole pile, no matter what card is on top of it.

If the played card is not a jack and is not equal to the previous top card of the pile, the played card is simply added to the top of the pile. When all the players have played their four cards, the dealer deals another batch of four cards to each player from the stock (but no more to the centre of the table) and play continues. When these cards are played, the dealer deals a further batch of four cards each. With four players, this third deal exhausts the pile. When everyone has played their last four cards, any cards remaining on the stack are given to the last player that made a capture. After there is no more cards in the pile, scores of players are calculated from the cards they have captured. If the pile consists of just one card and the next player captures it by playing a matching card (not a jack), the capturing team scores a 10 point bonus for a pişti. If the pile consists of just a single jack and you capture it with another jack, this counts as a double pişti, worth 20 points. A pişti can happen at any stage of the game, except that you cannot score a pişti for the very first card played by the player to dealer's right (capturing the original centre cards) nor for the very last card played by the dealer (just before the hand is scored). Points are scored for particular cards, for the majority of cards, and for each pişti as follows:

Pointing in Pishti
Cards and Actions with valuePoints
Each jack1 point
Each ace1 point
Club 22 points
Diamond 103 points
Capturing the most number of cards3 points
Each pişti10 points

Normally there will be 16 points to be divided between the players, plus the piştis. However, if there are two players that capture the same most number of cards, the 3 points for capturing the most number of cards is not awarded.

Download

Pishti class library: (source) (jar)

A sample implementation with dummy players: (zip)

Implementing a player strategy

To implement a player, you need to create a class that extends Player abstract class and thus implements

  • notifyTableEvent(TableEvent evt)
    This method of each Player is called to inform the players about what is going on in the game. evt can be a CardThrownEvent or a TableCleanedEvent.
  • Card selectCardToThrow()

Demo

Acknowledgement

The images of cards are taken from here. Pishti rules were partly taken from here.

HTML generated by org-mode • rssvalid xhtmlvalid csscc by sa 3.0 unless stated otherwise.