Ok, please look over the HP 41 Yahtzee game here
|
01-23-2016, 11:06 PM
(This post was last modified: 01-24-2016 12:09 AM by Gene.)
Post: #1
|
|||
|
|||
Ok, please look over the HP 41 Yahtzee game here
The .raw file linked to here is the current version of my 31 year on/off interest in a game for the HP 41 platform to play the dice game Yahtzee. The .raw file program is 636 bytes long.
Yahztee raw file Wiki link for basic rules of the game here: wiki link The game includes the small straight routine posted here on the forum by Werner as part of the HHC 2015 programming contest. I modified it only to change register references and the labels used. Note: The sorting routine uses the RAD indicator in the display to indicate numbers are being exchanged/sorted. I find this rather cool to see it flashing on and off. Basically to play: XEQ YZ Enter a decimal seed between 0 and 1. Choose the position of the dice you wish to roll. If you see 23356 ROLL? displayed and want to keep the 3's and roll the 2, 5 and 6 again, key 145 R/S. You get two rolls and then have to score. To score, enter the number of the scorecard row you want to use and press R/S. If you cannot remember which ones are still open, press 0 at this point and press R/S. By the way, if you get a good roll initially or before prompted for the SCORE? you can enter a 0 instead of the positions of the die and it will skip rolling any dice and immediately go to the SCORE prompt. Why would you want to do this? Suppose you get 22222 ROLL? on the first roll? That's a yahtzee and you should want to score it in row 12. To do that, press 0 R/S and you will see 22222 SCORE? Key 12 R/S and it will score in yahtzee if that row was previously unused. If you skip ahead to SCORE? but then realize you really want to go back and ROLL then you are stuck. No can do. The scorecard is as follows: 1-6 - score the number of each 1, 2, ... 6 you received. 7 - 3 of a kind 8 - 4 of a kind 9 - full house (3 of a number and then 2 of some other number) 10 - small straight 11 - large straight 12 - yahtzee (5 of a kind) 13 - chance - total of all dice shown If you get 63 or more points in the rows 1-6 of your scorecard you get a bonus of 35 extra points. This game does not implement "bonus" yahtzees if you get more than one in a game. Feel free to : 1) Find bugs :-) 2) Rationalize the labels used. Been a long time and other than labels 1-13 the labels used are not critical. 3) Suggest improvements 4) Add bonus yahtzee scoring 5) Play it and have fun. :-) I'm hoping some of you can check it out before it gets committed to Angel to update the version used in the FUNSTUFF rom that goes into the HP 41CL. The program in there now has bugs in the LBL 10 small straight section. Thanks and enjoy. |
|||
01-24-2016, 12:36 AM
Post: #2
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Here's the code for the game. Note that the NOT EQUAL character is shown as != in this listing.
Code: LBL "YZ" |
|||
01-24-2016, 03:18 AM
Post: #3
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Hello Gene,
Very nice RPN implementation of one of my favorite game when I was a kid. I played three games on Genesis-41 OSX simulator and it worked flawlessly. I have a small suggestion, since you made it for the 41, why not use the auto-assigned labels (A..J,a..e) for actions. We could then create an overlay for your game! Thank you for sharing. Best regards, Sylvain Here is my suggestion for the labels ... Code: Now Label Action |
|||
01-25-2016, 01:28 PM
Post: #4
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Thanks Sylvain.
I'm particularly interested in: The scoring routines - especially for cases that should fail. 11235 should not be a small straight - does it score as one? (Answer no, but there are lots of such cases) and Places where my routines are byte hungry. The Large Straight routine (LBL 11) for example - can it be done shorter? How? FYI - Labels 01 through 13 score the corresponding row on the scorecard. LBL 07 is the 3 of a kind label. Thanks all. Please play the game and help test it before it gets replaced in the FUNSTUFF rom. |
|||
01-26-2016, 08:59 PM
(This post was last modified: 01-26-2016 08:59 PM by Guenter Schink.)
Post: #5
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
(01-25-2016 01:28 PM)Gene Wrote: Thanks Sylvain.Gene, you haven't recognized my refined and very compact solution that I posted here three weeks after the conference. Based on that approach I offer a combined routine for the small and large straight, which is 39 lines long Code: LBL 10 Start for small straight In your code you have "+" right after "LBL 11" . As I have no idea what that's for, I left it in, may be it can be deleted. Hope you can use it, Günter |
|||
01-26-2016, 09:05 PM
Post: #6
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Thank you Guenter! I must have missed it.
I will look it over and try it out. Thanks for making the adjustments to the registers, etc., used in the program. Gene |
|||
01-26-2016, 09:18 PM
Post: #7
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
About that +
Perfect find. No idea why I had it in there. When the call to LBL 11 is made, the X register has a 0 in it and the program was recalling a value and adding it to that zero. No harm, but totally unnecessary. Oops. Probably got dropped in 25-30 years ago when I was in graduate school and never thought about again. ty |
|||
01-26-2016, 09:33 PM
Post: #8
|
|||
|
|||
New version of Yahztee game
Saved 27 bytes incorporating your combination routine. Many thanks. Now 611 bytes.
Code: Code: LBL "YZ" HP 41 barcode: YZ Barcode Raw file: Yahtzee raw file |
|||
01-26-2016, 09:51 PM
Post: #9
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
[quote='Gene' pid='49892' dateline='1453844018']
Saved 27 bytes incorporating your combination routine. Many thanks. Now 611 bytes. Code: [snipped] Nice! However I'd suggest you delete the "ENTER^" after the 2 "XEQ 35" statements. While it doesn't change the byte count, I think it's less clutter. Günter |
|||
01-26-2016, 10:07 PM
Post: #10
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Funny. :-) I added the ENTER to make sure the code was more readable from the listing. I've seen times when lines without an enter were considered a mistake and the two numbers were joined!
|
|||
01-27-2016, 02:48 AM
Post: #11
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Some years ago, I modified the scoring table for Yahtzee (I had learned the game under the name of General; I think the game comes from Cuba.) If I can find them, I'll send you the new scoring rules. There are some bonuses that one can play for (at the risk of losing other scores, of course) and I found the game much more interesting.
|
|||
01-28-2016, 12:53 AM
Post: #12
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Hi Gene,
Is there an annotated/commented listing floating about -- at least maybe explaining the purpose of the various sections/subroutines? stephen |
|||
01-28-2016, 04:24 PM
(This post was last modified: 01-28-2016 07:05 PM by Gene.)
Post: #13
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Try this:
Code: SIZE 024 |
|||
01-28-2016, 05:50 PM
Post: #14
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
RAW file ready for prime time??
"To live or die by your own sword one must first learn to wield it aptly." |
|||
01-28-2016, 07:02 PM
Post: #15
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Regarding this section of code and converting it to a DSE 19 approach...
Code: LBL 17 I have found that it raises my byte count by 4 bytes with changes that have to be made elsewhere. So, I think I will leave it as-is. I am also changing line 134 which is presently an append blank space to an append + instead. Angel, the .raw file will be sent by tomorrow if at all possible. |
|||
01-28-2016, 08:18 PM
Post: #16
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
20160128
Current .raw file for emulators: YZ raw file Current PDF of listing: Yahztee PDF Barcode (yes!) of current version: Yahtzee barcode |
|||
01-28-2016, 08:30 PM
Post: #17
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
(01-28-2016 07:02 PM)Gene Wrote: Angel, the .raw file will be sent by tomorrow if at all possible. (01-28-2016 08:18 PM)Gene Wrote: 20160128 Slow day at work? Oh, wait, what am I doing now? --Bob Prosperi |
|||
01-28-2016, 08:34 PM
Post: #18
|
|||
|
|||
RE: Ok, please look over the HP 41 Yahtzee game here
Quiet lunch time.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)