(71B) YATZEE 71 1.2 For HP-71B
|
12-24-2013, 04:53 PM
(This post was last modified: 06-15-2017 01:28 PM by Gene.)
Post: #1
|
|||
|
|||
(71B) YATZEE 71 1.2 For HP-71B
Namir's Battleship game inspired me to dust off two HP71B dice games I wrote some years ago, YATZ71 and ROLLERS. Both programs rely on subroutines contained in a file called DICESUBS, which I will include with both programs in seperate postings.
YATZ71: Code:
And DICESUBS: Code:
YATZ71 documentation: $Id: Y71DOC.txt,v 1.2 2011/04/12 02:34:09 hbo Exp $ YATZ71 Table of Contents I How to Play II Scoring a The Upper Half b The Lower Half c Zeroing and Such d Viewing the Score Card III Miscellany a Shutting up the Beeps b Ending the Game Normally c Ending the Game Abnormally d Battery Hog VI License Yatz is a well known game that involves 5 dice and scoring similar to poker. You roll five dice to start, then "draw" by rolling the ones you don't like again to try and improve your hand. A more detailed description of the game follows in section IV. III How to Play To start the program, type "run yatz71". (I will assume you have loaded the program, by hook or by crook, so that command will work.) After a moment, you will see five dice. press the number keys 1 through five to toggle the corresponding die off and on. The first press turns a die "off" so that its image disappears from the screen. A second press of the same number will turn the die back "on" and its image will reappear on the screen. When you have selected which dice you want to throw away in this manner, press the END-LINE key. Yatz71 will roll the dice you threw away and present you with the result. You can then repeat the process once more before yatz will demand that you select a score for your hand. If you want to score the hand you have at any point before you have rolled three times, just press END-LINE without turning off any dice. Yatz will take you right to the scoring prompt. IV Scoring When your three turns are up (or earlier than that if you choose) Yatz will display a prompt to the right of the dice images that looks like "S?> " This is the scoring prompt. Yatz's score card has thirteen entries, or "slots," numbered one through thirteen. You are expected to enter a number in this range to select which slot you want your dice score to be entered in. IV.a The Upper Half The first six slots are the "upper half" of the score card. They represent each of the dice, numbered one through six. You have to try to fill each of the "slots" in the upper half with dice of the corresponding value. So if you end up rolling three fours, for example, you could select "4" when prompted, and your three fours will be scored as 3 x 4 = 12 points. If you had four fours, that would be 16 points. two fours would be eight and so forth. (You could even have zero fours, which would score zero points.) You want to try to average at least three of each of the six die values in the corresponding upper half slot. That's because you get a bonus of thirty five points if your upper half score is sixty three or above. That happens to be exactly what you will score if you get three of each number in the upper half. You can also get the bonus by scoring four of something and less of something else. For example, if you scored four sixes, you would have six extra points to play with. You could then get by with only two fours and only two twos. Or you could score two fives and two ones. It's a "mix and match" kind of thing. Yatz gets worried if it sees that you are scoring less than par on any slot in the upper half. It will issue an "uh-oh" kind of sound in that case. It won't matter if you already have four sixes, for example, the program isn't smart enough to look for that. IV.b The Lower Half The other seven slots in the thirteen slot score card are the "lower half." They have various values and scoring rules given below: Code:
You can only fill most of these slots once. You can put zero in any of the slots if you have nothing better to play, but then that is it for the particular slot for the rest of the game. Yatz is an exception to the first rule, but not to the second. That is, if you put a zero in the Yatz slot, number twelve, you can't score yatz anymore for the rest of the game. However, if you do get a yatz, then later get another one, you can score it all over again. You would have 100 points in your yatz slot after the second yatz, then 150 and so on. Five of a kind is hard to get, so its an exceptional game when you can take advantage of this rule. IV.d Viewing the Scorecard When you are rolling the dice, you can view the status of your score card by pressing the "S" key (or the "+" key, or "g +" which is the question mark). the status of slot one, the one's place in the upper half, will be shown. Pressing the down or right arrows will walk down the slots (toward higher numbers.) Pressing the left or up arrows will walk up the slots toward lower numbers. The slot numbers will "wrap" at the ends. So pressing the up arrow in slot one will show slot thirteen, and the down arrow in slot thirteen will show slot one. Each slot will show its name, "1" through "6" for the upper half, and the labels shown above for the lower half. Opposite the names will be the values stored in the slots. A -1 in the slot means that it is unused. Any other value means the slot has already been scored with that value. Pressing the END-LINE key will return to the dice selection and rolling mode. V Miscellany V.a Shutting up the Beeps This program beeps a lot. If this annoys you, you can execute BEEP OFF before starting it up. Also, pressing "Q" when in the dice rolling mode will toggle the beeper on and off. Yatz will remember whether the beeper was on or off when it first started up, and will restore the beeper to that state when the program exits normally. Ending the Game Normally If all thirteen slots in the score card are filled, yatz will print the totals of the upper and lower halves together with the bonus, if any. It will then print the grand total and exit. Before doing so, the program will restore the beeper as mentioned above, and set WINDOW 1 to return the display to its normal mode. Ending the Game Abnormally If you get sick of the game while playing it, you may want to end it early. You can do this by pressing the ATTN (ON) button. (Throwing the machine against the wall is not recommended.) If you do this, the display will not be restored to its normal mode. You will have to type "WINDOW 1" yourself to get the display back to normal. Also, if you changed the beeper setting in the program, and that setting was different from your normal beeper setting, interrupting the program will leave the beeper ON or OFF as the case may be. You will have to manually set the beeper yourself to change this, by typing "BEEPER ON" or "BEEPER OFF" as appropriate. Battery Hog Besides beeping a lot, Yatz71 uses the system KEY$ routine to poll for input. That means that it won't go to sleep if you leave the machine on like it normally would. (There are better keyboard entry routines in various LEX files, but I wanted this program to run on a stock HP-71B.) The moral is: don't do that. Turn off the calculator, or exit YATZ71 by pressing the ON button before you go off and leave it alone. License Copyright (C) Howard Owen 2005,2011 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author may be contacted by electronic mail at hbo@egbok.com. Regards, Howard |
|||
03-12-2017, 03:43 PM
Post: #2
|
|||
|
|||
RE: YATZ71 1.2 For HP-71B
Like Battleship, very cool!
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)