Building an Agent for Mark — Part 1: Introduction to the Mark Game

A friend of mine (msaba) asked me to develop an agent to play the Mark game he is building. After several months of delay due to my master’s studies and limited free time, I finally started working on it. In this document, I will share the steps I take and the progress I make while building the agent for Mark.

What is Mark?

Mark (مارک) is the name of a card game that is only popular in Dezful. It is a modified version of Shelem, Bridge, and Hokm and is played by four people in two teams of two. The game is not known outside Dezful, so I’m going to explain it in details :)

Setup and dealing

The four players sit in two partnerships with players sitting opposite their partners. A cardinal direction is assigned to each seat, so that one partnership sits in North and South, while the other sits in West and East. The deck is shuffled and cut, usually by the player to the right of the dealer, before dealing. Players take turns to deal, in clockwise order. The dealer deals the cards clockwise, 4 cards to each player for the auction. After the auction is completed, then each player receive their remaining cards until each player have 12 cards in their hands. The remaining 4 cards form a ground hand, to be taken up by the player who have won the auction (who we refer to as the Hakim).

Auction

The player left to the dealer starts the auction by telling how much score their team can get (in multiples of 5) and specifying the trump suit. The players bid for the privilege of taking up the ground hand and making trumps. The minimum bid is 80, and there are 165 points in the game. A player who does not want to overbid the previous bid may pass to their teammates, each team can pass to their teammates up to 3 times. The highest bidder becomes Hakim, takes up the ground hand, and discards 4 cards face down to return to the original number of cards (12). The discarded pile becomes the Hakim’s team’s first trick (including any points).

Play

Hakim leads to the first trick. The remainder of the deal is played according to the standard trick-play rules as in Shelem or Hokm. Tricks are won by the highest trump, or if there were none played, the highest card of the led suit. Tricks are won by the highest trump, or if there were none played, the highest card of the led suit.

Scoring

Each party makes the card-points in tricks won plus 5 points for every trick. If Hakim’s party is successful, they score what they made, if they win all tricks (i.e., achieve a Mark). If they are not successful, they’ll get zero point and the opponents get the whole 165 points. There’s no penalty for scoring points above the bid amount.

After all 12 cards have been played, each team counts their points. Each trick is worth 5 points. In addition, if the hand contains five, ten, or ace cards of any suit, five, ten, and ten points are added to the trick’s total point. The total points scored by the Hakim team and the opposing team will be 165. If the Hakim team succeeds in claiming points they’ve bid, the points they claimed are added to their total points and the opposing team also adds any points they score to their total points. If the Hakim team are not successful, they’ll get zero point and the opponents get the whole 165 points. There’s no penalty for scoring points above the bid amount. If the Hakim team win all tricks (i.e., achieve a Mark), they’ll get double the points, 330.