Next: , Previous: , Up: Machine learning with tarot   [Contents][Index]


5.2 Implemented strategies

The strategies are computed from a game (optionally with a counter) and an event that has not occured yet in the game. Just like for the features, there is a perfect redundancy with the ‘Game’, ‘Counter’ and ‘GameEvent’ APIs.

Function: void tarot_strategy_bid (const TarotGame *game, const TarotGameEvent *event, int *pass, int *take, int *push, int *straightkeep, int *doublekeep)

Query the strategy implemented by playing the bid event in game. This function is very simple, it just encodes the bid in event. More specifically, pass is always set to 1. If the player takes, then pass and take are set to 1. If she pushes, then pass, take and push are set to 1. And so on.

Function: void tarot_strategy_outbid (const TarotGame *game, const TarotGameEvent *event, int *outbid)

Compute the outbid implemented by playing event in game. The value is positive if we outbid, negative if we pass. It can be zero

Function: void tarot_strategy_call_by_length (const TarotGame *game, const TarotGameEvent *event, int *shortest, int *second_shortest, int *second_longest, int *longest)

Check if we are calling the shortest, second shortest, second longest or longest minor suit by adding event event to game.

Function: void tarot_strategy_call_myself (const TarotGame *game, const TarotGameEvent *event, int *self)

Check whether the taker would call herself for sure by adding event event to game. Obviously the case when the called card is in the dog does not count as deliberately calling oneself.

Function: void tarot_strategy_call_marriage (const TarotGame *game, const TarotGameEvent *event, int *will_own_marriage)

Check if the taker will own the marriage of the called card. This is true in exactly two cases:

  1. The taker calls the king of a suit for which she has the queen;
  2. The taker calls the queen of a suit for which she has the king.
Function: void tarot_strategy_discard_save (const TarotGame *game, const TarotGameEvent *event, int *queens, int *knights, int *jacks)

Count the number of face cards (number of queens, number of knights and number of jacks) that the taker has saved by discarding event in game. A saved card is a card for which there exists a higher card of the same suit that she does not own nor has called.

Function: void tarot_strategy_discard_junk (const TarotGame *game, const TarotGameEvent *discard, int *lesser)

Query the purity of the discard in game. This is the number of lesser cards that are left in the taker’s hand and for which one higher minor card of the same suit has been discarded.

Function: void tarot_strategy_discard_by_length (const TarotGame *game, const TarotGameEvent *discard, int *shortest, int *secondshortest, int *secondlongest, int *longest)

Check if the discard in game aggraves the imbalance of minor suit in the taker’s hand. Count how many cards are discarded from the shortest, second shortest, second longest and longest suit of her hand with respect from the hand with the dog.

The next strategies are all for playing. We analyze the card of the next player in game.

Function: void tarot_strategy_lead (const TarotGame *game, const TarotGameEvent *card, int *calledsuit, size_t *suitlength, size_t *ntimeslead, int *trumps)

Check if we lead the called suit, check the length of the lead suit (how many cards of that suit we have), count how many times this suit has been lead before, and whether it is actually trumps.

Function: void tarot_strategy_purity (const TarotGame *game, const TarotGameEvent *event, size_t *nsmallerkept, size_t *ngreaternonfacekept, size_t *npointskept, size_t *ngreaterkept)

Assess the purity of the card played: how many strictly smaller, greater (except faces, or counting faces) cards we keep in our hand, and how many points that makes.

Function: void tarot_strategy_excuse (const TarotGame *game, const TarotGameEvent *card, int *excuse)

Check if we are playing the excuse.

Function: void tarot_strategy_trump_master (const TarotGame *game, const TarotGameEvent *card, int *master, int *obvious)

Check if this trump is actually a master trump (noone has been or will be able to play better in that trick) and an obviously master trump, which is to say that all stronger trumps have already been played. This distinction is useful because if we play the 20 while keeping the 21, our allies won’t know that we have the 21.

Function: void tarot_strategy_play_points (const TarotGame *game, const TarotGameEvent *card, int *halfpoints, int *oudler)

Count how many half points our card is worth (the excuse is worth 9) and whether it is an oudler.


Next: , Previous: , Up: Machine learning with tarot   [Contents][Index]