~subsetpark/whist

An implementation of the rules of Bid Whist via the Tamerlane interface.
8fc382a6 — Zach Smith 10 days ago
Format all
b0f715a9 — Zach Smith 10 days ago
Add some explanatory text
ce6d559a — Zach Smith 10 days ago
Complete whist

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~subsetpark/whist
read/write
git@git.sr.ht:~subsetpark/whist

You can also use your local clone with git send-email.

#bid whist for tamerlane

This is an implementation of a rules engine for the tamerlane server architecture.

It provides a working implementation of the rules of Bid Whist, as well as a reference implementation for tamerlane.

#game phases

The game plays out in 5 phases.

+-------+                          +-----+                                                                          +---------+                                 +-------+                                     +-------+                                                               +-----+

| Deal  |                          | Bid |                                                                          | Discard |                                 | Begin |                                     | Play  |                                                               | End |

+-------+                          +-----+                                                                          +---------+                                 +-------+                                     +-------+                                                               +-----+

    | --------------------------\     |                                                                                  |                                          |                                             |                                                                      |

    |-| Deal 12 to each player. |     |                                                                                  |                                          |                                             |                                                                      |

    | |-------------------------|     |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    | Prompt first player for bid.    |                                                                                  |                                          |                                             |                                                                      |

    |-------------------------------->|                                                                                  |                                          |                                             |                                                                      |

    |                                 | ---------------------------\                                                     |                                          |                                             |                                                                      |

    |                                 |-| A player bids or passes. |                                                     |                                          |                                             |                                                                      |

    |                                 | |--------------------------|                                                     |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 | There is another player who has not yet passed. Prompt them for bid.             |                                          |                                             |                                                                      |

    |                                 |----------------------------------------------------------------------            |                                          |                                             |                                                                      |

    |                                 |                                                                     |            |                                          |                                             |                                                                      |

    |                                 |<---------------------------------------------------------------------            |                                          |                                             |                                                                      |

    |                                 | ----------------------------------------------------------------------------\    |                                          |                                             |                                                                      |

    |                                 |-| There is only one player who hasn't passed - that player is the declarer. |    |                                          |                                             |                                                                      |

    |                                 | |---------------------------------------------------------------------------|    |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 | Prompt declarer for their full bid.                                              |                                          |                                             |                                                                      |

    |                                 |--------------------------------------------------------------------------------->|                                          |                                             |                                                                      |

    |                                 |                                                                                  | -------------------------------------\   |                                             |                                                                      |

    |                                 |                                                                                  |-| Declarer makes the their full bid. |   |                                             |                                                                      |

    |                                 |                                                                                  | |------------------------------------|   |                                             |                                                                      |

    |                                 |                                                                                  | ----------------------\                  |                                             |                                                                      |

    |                                 |                                                                                  |-| Declarer draws six. |                  |                                             |                                                                      |

    |                                 |                                                                                  | |---------------------|                  |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  | Prompt declarer to discard six.          |                                             |                                                                      |

    |                                 |                                                                                  |----------------------------------------->|                                             |                                                                      |

    |                                 |                                                                                  |                                          | -------------------------\                  |                                                                      |

    |                                 |                                                                                  |                                          |-| Declarer discards six. |                  |                                                                      |

    |                                 |                                                                                  |                                          | |------------------------|                  |                                                                      |

    |                                 |                                                                                  |                                          | -----------------------------\              |                                                                      |

    |                                 |                                                                                  |                                          |-| Declarer scores one trick. |              |                                                                      |

    |                                 |                                                                                  |                                          | |----------------------------|              |                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          | Prompt declarer to play to first trick.     |                                                                      |

    |                                 |                                                                                  |                                          |-------------------------------------------->|                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             | Not all players have played to the trick. Prompt the next player.    |

    |                                 |                                                                                  |                                          |                                             |------------------------------------------------------------------    |

    |                                 |                                                                                  |                                          |                                             |                                                                 |    |

    |                                 |                                                                                  |                                          |                                             |<-----------------------------------------------------------------    |

    |                                 |                                                                                  |                                          |                                             | --------------------------------------------------------------\      |

    |                                 |                                                                                  |                                          |                                             |-| All players have played to the trick. Determine the winner. |      |

    |                                 |                                                                                  |                                          |                                             | |-------------------------------------------------------------|      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             | Prompt the winner to lead.                                           |

    |                                 |                                                                                  |                                          |                                             |---------------------------                                           |

    |                                 |                                                                                  |                                          |                                             |                          |                                           |

    |                                 |                                                                                  |                                          |                                             |<--------------------------                                           |

    |                                 |                                                                                  |                                          |                                             | ----------------------------------------------------------\          |

    |                                 |                                                                                  |                                          |                                             |-| All cards have been played. Determine the winning team. |          |

    |                                 |                                                                                  |                                          |                                             | |---------------------------------------------------------|          |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |               Neither team has won. Redeal. |                                                                      |

    |<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|                                                                      |

    |                                 |                                                                                  |                                          |                                             |                                                                      |

    |                                 |                                                                                  |                                          |                                             | One team has won. End.                                               |

    |                                 |                                                                                  |                                          |                                             |--------------------------------------------------------------------->|

    |                                 |                                                                                  |                                          |                                             |                                                                      |