Post Reply 
HHC 2019 will be in Reno, Nevada, Sept 21-22
09-30-2019, 05:13 AM
Post: #59
RE: HHC 2019 will be in Reno, Nevada, Sept 21-22
Just by looking at your code I noticed some questionable steps Smile

(09-30-2019 03:15 AM)Craig Bladow Wrote:  I used Dave's timing program to time my entry to the programming contest at HHC 2019.

It runs in 1.4 seconds on a DM42 running on battery.

The program reduces the search space to 8*8*8 by not evaluating some combinations that would sum to greater than 999.

Code:

00 { 134-Byte Prgm }
01▸LBL "cbsum"
02 9ᴇ-3
03▸LBL 01
04 ENTER
05 IP
06 3
07 Y↑X
08 STO IND ST Y
09 R↓
10 ISG ST X
11 GTO 01
12 1.009
13 STO 10
14 7ᴇ-3
15 STO 11
16 7ᴇ-3    @ <not needed, value already in X>
17 STO 12
18 14
19 STO 13
20▸LBL 02
21 RCL IND 10
22 RCL IND 11
23 +
24 RCL IND 12
25 +
26 CF 01
27 RCL 10
28 IP
29 100
30 ×
31 RCL 11
32 IP
33 10
34 ×
35 +
36 RCL 12
37 IP
38 +
39 X≠Y?
40 GTO 05
41 STO IND 13
42 1
43 STO+ 13
44▸LBL 05
45 ISG 12
46 GTO 02
47 7ᴇ-3
48 STO 12
49 ISG 11
50 GTO 02
51 7ᴇ-3
52 STO 11
53 ISG 10
54 GTO 02
55 14
56 RCL 13
57 1
58 -
59 1ᴇ3
60 ÷
61 +
62 STO 13
63▸LBL 03
64 RCL IND 13
65 ISG 13
66 GTO 03
67 STOP   @ <not needed, program stops at END anyway>
68 END

Cheers,
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2019 will be in Reno, Nevada, Sept 21-22 - RMollov - 09-30-2019 05:13 AM



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