HHC 2015 RPN programming Contest is now open - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HHC 2015 RPN programming Contest is now open (/thread-4804.html) |
HHC 2015 RPN programming Contest is now open - Gene - 09-26-2015 12:59 PM 1) No posting of any solutions to this forum until after 4pm central time SUNDAY 9/27. 2) Size of routine is all that matters. 3) No synthetic functions, etc. ONLY vanilla CAT 3 HP 41c functions allowed. Problem and rules found here: HP 2015 Programming Contest Questions? Ask me, but don't ask questions that might give things away. Enjoy. Goal is to have fun. RE: HHC 2015 RPN programming Contest is now open - Csaba Tizedes - 09-26-2015 06:15 PM (09-26-2015 12:59 PM)Gene Wrote: Questions? A.) 1-2-3-4-5 and 2-3-4-5-6 is not a Small Straight. B.) 15C programs are OK?!? Csaba RE: HHC 2015 RPN programming Contest is now open - Bill (Smithville NJ) - 09-26-2015 06:53 PM (09-26-2015 06:15 PM)Csaba Tizedes Wrote:(09-26-2015 12:59 PM)Gene Wrote: Questions? While 1-2-3-4-5 and 2-3-4-5-6 are a Large Straight, they are also considered a Small Straight. There are occasions in Yahtzee where you might want to score a Large Straight as a Small Straight. See the following rules: Yahtzee Rules Bill Smithville, NJ RE: HHC 2015 RPN programming Contest is now open - Gene - 09-26-2015 06:57 PM Bill is correct. 12345 contains two small straights - 1234 and 2345. All you need is one, so 12345 and 23456 are valid for a "small straight." 15C programs are fine, but be careful not to use a 15c instruction that is not a vanilla HP 41C instruction. No SOLVE lines in the program please. :-) RE: HHC 2015 RPN programming Contest is now open - Csaba Tizedes - 09-26-2015 07:02 PM (09-26-2015 06:53 PM)Bill (Smithville NJ) Wrote: might want to score a Large Straight as a Small Straight OK, It's clear now - thanks! Csaba RE: HHC 2015 RPN programming Contest is now open - TASP - 09-26-2015 11:23 PM How about a special mention for the highest byte count program that works ?? (the rest of the country seems to place a very high value on bloatware) RE: HHC 2015 RPN programming Contest is now open - Gene - 09-27-2015 12:25 AM Oops. This line on the programming contest file: "(C) 12356, 11111, 41623, 22344, etc., and then R/S should return something (anything) other than 0." Is incorrect. My fault. 41623 actually CONTAINS a small straight. If those values are fed into the routine, it should return a 0 because that is a small straight. The instructions/test case for that input is not correct. Sorry about that. Thanks Jackie! RE: HHC 2015 RPN programming Contest is now open - Gerson W. Barbosa - 09-27-2015 11:50 AM HP-41C 2121B58157. Main program has 44 steps including LBL and END, including one CALL to the SORT routine, but surely can be made a bit shorter. Also, some unelegant parts have to be rewritten, but I don't think I'll do that on time. About 70 bytes (not taking into account three extra registers) on the HP-42S (used only for byte-counting purpose), which compares to what was already available since the beginning. Running time about 7.5 seconds, including sorting time. I've forgotten to remove the Advantage Module, but I don't think I have used any forbidden routine or instruction. Thanks for another interesting programming contest. I hope you all are having fun at HHC 2015! Gerson. RE: HHC 2015 RPN programming Contest is now open - Allen - 09-27-2015 12:55 PM (09-27-2015 11:50 AM)Gerson W. Barbosa Wrote: Thanks for another interesting programming contest. I hope you all are having fun at HHC 2015! I agree! Thank you, Gene for a fun programming contest. I will not be home at 4pm central, but will post my solution later tonight. Code:
I wrote my original solution on the 42S but it used some functions that were not vanilla 41c instructions. Code:
I can include the 42s version tonight if anyone is interested. RE: HHC 2015 RPN programming Contest is now open - Csaba Tizedes - 09-27-2015 01:48 PM (09-26-2015 06:57 PM)Gene Wrote: Bill is correct. HP15C: 53 steps with one GSB for SORT, including LBL/RTN of main program R1~R5 + R0, R6 and I approx. 14-15secs if we have Small straight pdf doc will be posted at 10PM CET Thanks for this fun! Csaba RE: HHC 2015 RPN programming Contest is now open - Gerson W. Barbosa - 09-27-2015 06:53 PM In case it is useful for testing, here is a simple input routine: Code:
Congratulations to Allen, Csaba and everyone who have been working on this, especially to the people at HHC-2015. I guess it is a bit more difficult there, given the many activities they're participating in. I'm looking foward to your solutions! Gerson. RE: HHC 2015 RPN programming Contest is now open - Csaba Tizedes - 09-27-2015 07:19 PM (09-27-2015 06:53 PM)Gerson W. Barbosa Wrote: I'm looking foward to your solutions! Just one and half hour - I wrote a little mistake, because in Hungary 10 PM is only 3 PM in Central Time Zone, so I must to wait one additional hour now... Csaba RE: HHC 2015 RPN programming Contest is now open - Egan Ford - 09-27-2015 09:02 PM (09-27-2015 12:55 PM)Allen Wrote: I think my solution is the same as yours, however a bit longer and one less register. Code:
First pass, need to optimize for size. RE: HHC 2015 RPN programming Contest is now open - Csaba Tizedes - 09-27-2015 09:03 PM I hope the link is workable (uploaded into my Drive): 15C-008_HHC2015_Small straights _v1.0_.pdf Csaba RE: HHC 2015 RPN programming Contest is now open - Gerson W. Barbosa - 09-27-2015 09:11 PM Recall arithmetic wasn't missed this time, but the lack of some comparison tests on the HP-41 is always a problem, at least for me. Not so much improvement when compared to the first version this morning: Code:
Gerson. Edited to fix a typo RE: HHC 2015 RPN programming Contest is now open - Egan Ford - 09-27-2015 09:40 PM Improved version: Code:
RE: HHC 2015 RPN programming Contest is now open - Gene - 09-27-2015 09:47 PM The winning Nashville solution was 47 bytes. Ouch. Much smaller than my previous effort. I will post the code soon. Gunter Schink is the winner of the local contest. RE: HHC 2015 RPN programming Contest is now open - Egan Ford - 09-27-2015 10:00 PM (09-27-2015 09:47 PM)Gene Wrote: The winning Nashville solution was 47 bytes. Ouch. Much smaller than my previous effort. I should probably know this, but I do not recall. How do you measure bytes? Thanks. RE: HHC 2015 RPN programming Contest is now open - Gerson W. Barbosa - 09-27-2015 10:09 PM (09-27-2015 10:00 PM)Egan Ford Wrote:(09-27-2015 09:47 PM)Gene Wrote: The winning Nashville solution was 47 bytes. Ouch. Much smaller than my previous effort. There are tables, but an easier way is checking on the HP-42S or Free42, assuming the byte-counts are the same (not so sure, though). RE: HHC 2015 RPN programming Contest is now open - Dieter - 09-27-2015 10:17 PM (09-27-2015 10:00 PM)Egan Ford Wrote: I should probably know this, but I do not recall. How do you measure bytes? Thanks. There might be other tools, but the easiest way is using an HP41CX: Here CATÂ 1 shows the byte count of each program along with its END. Or simply plug in an X-Functions Module and save the program to Extended Memory (SAVEP). Then RCLPT returns the number of bytes. ;-) Dieter |