Cribbage Documentation


by David Teach

Copyright (c) 1993-2004

Requirements / Recommendations to play

Requires EGA, VGA, MDA, AT&T 400, PC 3270, or Hercules graphics system.

A Microsoft, Logitech, or compatible mouse is recommended.
Three button rodents work better for the hint feature.

An IBM or compatible AT computer with 8 mHz or faster CPU speed is also recommended.

How to play this computer game
When using the mouse, commands are selected with either the Left or Right mouse buttons. When in keyboard mode, the numbers or letters for the commands are highlighted in light green; or on monochrome displays the appropriate key is bright white or underlined.

When the information box pops up in the middle of the screen during play, it will stay on the screen for 5 seconds. Hit any key or mouse button to clear it quicker.

***** If the mouse cursor is not present in the Options, High Scores, or Statistics screens, then you have a problem with your mouse driver not accessing the second video page. Get an updated mouse driver, or use the NOBLANK command line option to disable video paging.

***** Monochrome EGA/VGA and/or 64k EGA users: If the colors don't come out correctly or if you cannot go to the Options or Stats screens, try using the LAPTOP command line parameter. I set this up to force the program into 2 color/1 video page on these systems. With all other configurations the LAPTOP toggle works normally.

The Title Screen:

Typing 'B' or clicking the left or right mouse button on the BEGIN GAME box starts the game with the shown options. Hitting ENTER will also choose this.

Typing 'O' or clicking on OPTIONS will bring up the game Options Menu. See "Options Menu" below for the list of options.

This displays the current player's cumulative game statistics. Users of the keyboard hit the 'S' key.

QUIT will exit the program. Type 'Q' from the keyboard.

The Options Menu:
This option will bring you back to the main menu. (Title screen) You can hit the letter 'M' or the ENTER key to select this in keyboard mode.

The default name is 'PLAYER'. You can change this by typing 'N' or clicking the mouse pointer within the red box around the name, typing a new name, and pressing ENTER (or a mouse button). Backspace is the only editing key allowed if you make an error while typing in the name. Upper and lower case letters, numbers 0 through 9, characters ! . , " - : / ? and spaces are also allowed. The name can be a maximum of eight characters long.

? -
Next to the player's name is a question mark that when clicked on will list all the players in the statistics file so that you can look up a name that was used before without having to remember it.

Clicking on SCORE LIMIT cycles the pegging board total between 121 and 61 pegs. Use either mouse button, or the + or - keys.

Changing the SKUNKING option to YES will allow a skunk win. If a player fails to reach the skunk point (limit - 30) with at least one peg by the end of a game, this counts a 2 wins. When playing to 121 points, the skunk line is after the 90th hole; for a 61 point limit it is after the 30th. This may also be called a "lurch" by some players. Double skunk (halfway for 121 limit) is NOT implemented. Hit the 'K' key from the keyboard to toggle skunking on or off.

This is an option to manually count the points in your hands when playing. If you count wrong, and are too low, you will only score what you specified. Stating a number that is too high will score only the real total minus the difference between it and the total you specified. No matter how high you report, you can't peg backwards with a negative count, just peg for zero points.
Examples: You say 5, really is 6 ----> only peg 5
You say 8, really is 6 ----> only peg 4 (6 minus 2)

This option is only valid if TALLYING is on. If, when you count your hand, the points are incorrect, the computer will score the difference. Of course you also still score only real total minus the difference also, so this is almost like a double penalty.
Examples: You say 5, really is 6 ----> only peg 5, computer pegs 1
You say 8, really is 6 ----> only peg 4, computer pegs 2

*** Programming note about the above two options:
(I'm getting the tallying and muggins rules out of a book, so it might not be exactly how some people score. If I only gave an error on high totals and let you do it over again, some might just start high and keep decrimenting until it was right. I could just bump the high counts to the correct total, but again that would have people just inputing 99 points every time. This doesn't play very well, so there is a penalty which might not be how it is used in real life games. If I'm wrong, or you are unhappy with this, please let me know.)

Changing the value of DELAY will allow you to control how long the message boxes remain on the screen before clearing. Valid values are from one to nine, and the infinity symbol. Click the right or left mouse buttons to increase or decrease the delay in seconds. To leave the message boxes up until a keypress or mouse click, choose the symbol that looks like two zeros next to each other. (infinity)

The default card set has more realistic-looking cards, but the suits may be a little small for some people to see clearly. If this is so, or you just like the one pip better, changing this option to YES will give you cards with one big number and one big symbol for the suit. Hit the letter 'B' to switch this option to YES or NO.

Clicking on this option will change the shape of the mouse pointer. There are seven different shapes to choose from. Obviously, this will not have any effect if you are not using a mouse, but 'P' still toggles.

Selecting SAVE will save all options to the CRIBBAGE.CFG file. This file is loaded when the program is run, so your name and your favorite options are already set. If this file is not present, or is corrupted, it will be created with the default options. At present, the NOBLANK option is not saved in this configuration file. 'S' from the keyboard.

Player Statistics Screen:
Clicking within the Main Menu box will bring you back to the main menu. (Title screen) You can hit the letter M or the ENTER key to select this in keyboard mode.

The Statistics file -
Also at the end of each game, the program checks for a stats file called CRIBBAGE.STA in the current directory. If it is not there, it is created. This file saves cumulative totals for average score in your hand and in your crib, the total number of games won and lost, the total number of hands played and the player's name. If your stats file is corrupted, or you just want to clear the list and start over, erase (or rename) the CRIBBAGE.STA file. You can have up to 20 different names currently running in this stats file. If the current player name is not found in this file, it is added to the top of the file with zero totals. WARNING, if this addition makes more than 20 names, the name on the bottom of the list (the oldest) is truncated.

******* If you quit a hand before the END of the game, the statistics file WILL NOT be updated for the hands that were played.

******* If you are playing Cribbage on a write-protected or read-only drive, the stats will start from zero when you start the game; they will be kept for when you are in the program, but cannot be saved upon exit. Use the command line path function to read and save to a writable drive.

Rules of the Game - Taken from "Official Rules of Card Games", 62nd edition, U.S Playing Card Company, 1968

Rank of cards:
(High) K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2, A.

The Deal:
Each player receives 6 cards. The players then choose two cards to discard. The four cards discarded by the two players constitute the CRIB, which always belongs to the dealer.

After both players have discarded their two cards, the deck is cut and one card is placed face up from the deck. This card is the STARTER. If the STARTER is a JACK then the dealer PEGS (scores) 2 points. This his known as "his heels" or just "heels".

Game play:
After the STARTER has been turned, play begins with the non-dealer laying down a card face up on the table. The dealer then next exposes a card with the play alternating between the two players, except for GO's as noted below. Each time a player lays down a card he announces the sum of all the cards that have been laid down so far.

During play, the sum can never exceed 31. If a player cannot play a card without exceeding 31 he must say GO and his opponent pegs 1 point. Before pegging his 1 point the player gaining the GO must lay down all the cards he can without exceeding 31. If a player reaches exactly 31 then he pegs 2 points instead of 1 point for the GO. The player who said GO starts off the next round of play, and sum is reset to zero.

The object in play is to score points by pegging. In addition to the GO, a player may peg points in the following combinations:

Pegging Combinations:
You peg 2 points for adding a card that makes the sum equal to 15.

You peg 2 points if you match the rank of the previously played card.

Adding the third card (in a row) of the same rank scores 6 points.

Adding the fourth card (in a row) of the same rank pegs 12 points.

RUN (Sequence)
For adding a card that forms with previously played cards a sequence of 3 or more, in any order, you peg 1 point for each card in the sequence. Runs are independent of suits and can be played in any order. Example: 3-4-5, 3-5-4, 5-2-4-3, etc.

Scoring Hands:
When play ends, the three hands are counted in order: non-dealer, then dealer's hand, then CRIB. This order is important, since toward the end of a game a player might be able to reach a winning score before his opponent has a chance to count his hand. The STARTER is considered a part of each hand, so all three hands contain five cards when scored.

The following describes the basic formations for scoring the hands:

2 points for each combination of cards that total 15.

2 points for each pair of cards of the same rank.

Each combination of 3 or more cards in sequence counts 1 point for each card in the RUN.

Four cards of the same suit (not including the STARTER) is 4 points. If the STARTER is also the same suit, count 5 points instead of 4. Only a 5 card flush counts in the CRIB.

Holding a JACK of the same suit as the STARTER counts as 1 point. This is known as "his nobs" or just "nobs".

**** Note: EACH and EVERY combination counts separately. ****

A hand (with STARTER) of 8,7,7,6,2 will score 16 points. How? For four combinations that total FIFTEEN: the 8 with one 7 and also with the other 7, and the 6-2 combined with the two 7s will score 8 points. It also scores 2 for the PAIR of 7s, and 6 points for the two RUNS of three: 8-7-6, using each 7 in turn.

(If you can't remember all this, don't worry; the computer does all the laying-off, counting, and rule enforcement for you.)

Winning and Losing:
The game ends the moment a player reaches the agreed score limit whether by pegging during play or when counting his hand. Once a player reaches the last peg hole, no further points are counted.

Hints -
The center button (recommended), or both left and right buttons pressed simultaneously will ask the computer for a hint. When using the keyboard, the letter H brings up the hint suggestion.

CAREFUL: If you are using both left and right mouse buttons to ask for hints, you must make sure that the mouse pointer is NOT OVER a regular choice area, (deck, card in hand, quit, etc.) or else the game will usually think that you made a normal choice with a single button. If you have a center button, use that instead; this will work for hints ANYWHERE on the screen, even over normal choice areas.

IF YOU HAVE A THREE BUTTON MOUSE, BUT THE CENTER BUTTON DOESN'T DO ANYTHING, you probably are using a different mouse driver than the one which came with your mouse. A three button mouse MUST be driven by a three button mouse driver. Most of the Microsoft mouse driver programs are for two button rodents. They seem to work fine for all operations of the mouse except for the center button. If you have a problem, look around the BBS's for a newer mouse driver, (I use Logitech mouse driver version 6.24) or contact the company where you purchased your mouse.

The Screen Saver -
If no keyboard or mouse input is detected for a certain amount of time during the game, the screen will blank out to prevent burn-in. The time limit for this is set by the game score limit. The time of waiting is 5 minutes for a score limit of 61, and 10 minutes for a score limit of 121. If your favorite score limit does not match your wanted screen saver time, learn to live with it.
To activate the screen blanker immediately, move the mouse cursor into the upper right hand corner and the screen will automatically blank out. This can be handy for the traditional use of a "Boss key" function. In keyboard mode, the ESCAPE KEY is the activation key.


*** To get out of the blank screen, press any key or mouse button. ***

Notes on the Computer player -
The computer does NOT "cheat" when playing. It does not look at your crib when discarding, it does not look at your hand, or do any other thing that a human player cannot do. The computer chooses its cards by a set of fixed formulas that do not have any room for human "intuition" or for many of the different possible arrangements of the hand that might make a good human player choose a different discard than the computer.

The "Hint" function uses about the same formulas for choosing the player's card(s) that the computer uses for its moves. This means that if you depend too heavily on the hints, you will end up winning only about half of your games.

Command Line Options:
The default setting for the two options NAME and SCORE LIMIT can be set from the command line, overriding (but not overwriting) the configuration file settings. This can be handy to set up some batch files for different players on one machine.

At the DOS prompt, you can do the following:

To get a quick help screen for the command line options, type CRIBBAGE followed by /? or ? or help or HELP. This must be the first parameter.

To list all of the contents of the statistics file from the DOS prompt, (in case you forget who is in there) type: CRIBBAGE list

To list the contents of this documentation file from the DOS prompt, (in case you can't view it any other way) type: CRIBBAGE view

**** NOTE: The previous three command line parameters (help, list, view) must be the FIRST parameter given, and all will exit to DOS when done.

To set the SCORE LIMIT, type: CRIBBAGE 61 or CRIBBAGE 121

To have the game use your name instead of the default name, you can state it as a command line option. ex. CRIBBAGE Dave

For the Command line option of Player Name, the length limit is 8 characters and the name must be ONE word. You can use BobSmith, or Ron_Hill, etc., but typing Paul Schoenberger will give you Schoenbe for your name. If you want a space in your name, you can put one in only with the Name Change from the options menu.

The name used is the LAST word on the command line that is NOT otherwise recognized as a command, so be sure not to have any gibberish on the line when you start the game: CRIBBAGE Mike ASDF will make your name ASDF not Mike.

This option will disable all disk access that the program uses. That includes loading and saving both statistics and options. All the options will be set to default when first running the program, and the statistics will still work for the current session (starting at zero), but will not be saved upon exit of the program (or when changing the player's name).

To disable the screen saver function, use the word NOBLANK in your command line options. This parameter will also disable the manual screen blanking (boss key), since both are really the same function.

If you have a monochrome monitor, like on many older LCD laptops, and you aren't using a mouse, the switch LAPTOP will use a brighter shade for the highlighted letters to make them easier to see.

If you want the dialogue boxes not to disappear after the set delay so that you can look at the point counting of the hands, use the PAUSE command line switch or set the delay to infinity on the options screen. This may help when trying to learn how to count the points for beginners.

If you want to have the configuration and save files read and saved from or to a different drive or directory, you may specify a file path on the command line. Valid paths must start with a backslash (\) or a drive letter and colon (B:) or parent directory dots (..)

Valid path examples are:

If just the drive letter is given, then the current path is used on that drive. (meaning if you are in D:\GAMES and then change to drive C: and run "CRIBBAGE D:" then your game files will be saved in D:\GAMES.

If a path is given, it is tested at game startup, and if it is invalid for any reason, the current directory will be made the default path. As always, if a path not is specified, the current directory is used.

To go directly into the game, bypassing the intro screen, use the command GO from the DOS prompt. ex. CRIBBAGE John B:\ go

Since the game looks only at the first eight parameters given, too much garbage on the command line might miss a legitimate option. Example: CRIBBAGE 1 2 3 4 5 6 7 8 GO will NOT execute the GO command.

These options can be put in any order and are all case INsensitive except for the Player Name.

If you are using Window 95/98 and running the game using a shortcut, it is almost as easy to specify command-line parameters. Just right-click on the program's shortcut icon, select PROPERTIES, and edit the TARGET line (where it gives the path to the *.EXE file) to put whatever you want behind it, separated by spaces. You can even create more shortcuts for different user names or other options. After that, whenever you click the shortcut, it will run those options for you, overriding the defaults saved in the options menu of the game.

This program is written in Turbo Pascal Version 7.0

The Mouse code is from the book "Turbo Pascal Advanced Programmer's Guide" by Stephen K. O'Brian. This unit was slightly modified by me.

Please feel free to write me if you have any questions, comments, improvements, or find any bugs.



When writing to me please tell me where you obtained Cribbage, and be sure to include the version number of the game that you currently have.

back Return to the GinRummy DOS Home Page