Post Reply 
HHC 2015 RPN programming Contest is now open
09-29-2015, 09:25 AM (This post was last modified: 10-16-2015 10:52 AM by Werner.)
Post: #43
RE: HHC 2015 RPN programming Contest is now open
Managed to squeeze off a byte:
42 bytes

Code:
01>LBL"RR"
02 4
03 RCL 05
04 10^X
05>LBL 01
06 RCL IND Y
07 10^X
08 +
09 DSE Y
10 GTO 01
11 X<>Y

12>LBL 02
13 SIGN
14 10^X
15 /
16 RCL X
17 1111
18 X>Y?
19 GTO 00
20 -
21 LOG
22 FRC
23 X#0?
24 GTO 02

25>LBL 00
26 END

Method: sum up all the dice values, well all 10^x of the dice values, and then a small straight is 1111(0)(0) + 10^y, or one power of 10 removed from 1111 followed by 0-2 0's. Subtracting 1111 and taking the LOG should thus produce an integer, or FP=0.
My first attempt looped 3 times explicitly, and that was 1 byte longer or so - but of course 1111 + 10^y > 1111, and that can be used as loop terminator.

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2015 RPN programming Contest is now open - Werner - 09-29-2015 09:25 AM



User(s) browsing this thread: 1 Guest(s)