cribbage
Play the card game Cribbage
SYNOPSIS
cribbage [ -r ] [ -s ] [ -p number ] [ -o score ]
PARAMETERS
-r
Starts the game from a random point, allowing for varied starting hands instead of always from the beginning.
-s
Shows the running scores during the pegging phase of each hand, providing real-time score updates.
-p number
Sets the game's winning score to number points instead of the default 121 points.
-o score
Starts the user's score at score points, which can be useful for practicing specific game scenarios or starting a game mid-way.
DESCRIPTION
The cribbage command allows users to play the traditional card game of Cribbage against the computer. The computer acts as the dealer and always deals the first hand. Gameplay involves dealing cards, discarding two cards to the crib (both by the user and the computer), and then playing out the hand by pegging points. After the pegging phase, hands and cribs are counted. The game continues until one player reaches a score of 121 points. The program prompts the user for card selections during discarding and pegging, and the computer attempts to make optimal plays.
CAVEATS
The computer opponent, while generally capable, might not always make the absolute optimal play in all situations. Some less common or nuanced Cribbage rules might not be fully implemented in older versions of the command.
GAMEPLAY INTERACTION
Users interact with the cribbage command by typing in card selections when prompted. For instance, during the discard phase, the user will be asked to choose two cards for the crib. During the pegging phase, the user chooses a card to play based on the current count. The program handles all scoring and game state management, indicating whose turn it is and the current pegging total.
The game continues turn-by-turn with card plays and point counting, until one player reaches the target score (default 121).
HISTORY
The cribbage command is a classic Unix game, often found in the games section of system distributions. Its origins trace back to early Unix systems, providing a simple interactive game for users on text-based terminals. It exemplifies the early tradition of including recreational programs within the Unix environment, demonstrating basic AI for card games. While its core functionality remains largely unchanged, its presence is a nod to the historical Unix gaming suite.