Post Reply 
Clock Hands Challenge
03-06-2019, 07:50 AM (This post was last modified: 03-06-2019 07:53 AM by RMollov.)
Post: #9
RE: Clock Hands Challenge
(03-06-2019 02:10 AM)Valentin Albillo Wrote:  English is not my first language (that would be Spanish) but I understood it like this:

"I wonder what would be the shortest program for a 2-line display HP/DM calc (i.e.: HP42S / DM42) that shows at what time (accurate to the second) past a user-specified hour (i.e.: 0:00, 1:00, ... 23:00) would the clock's hands form an angle of either 0º or 180º."

Best regards.
V.
.

Thanks, Valentin, that's it! English isn't my first language too Smile
One note, on an analog clock 13, 14 etc. do not exist, so the input ("Hour") is MOD'd to 12.
Thank you all, I should have posted here my solution which does what I meant. Here it is:

Code:

00 { 71-Byte Prgm }
01▶LBL "CLOCK"
02 IP
03 12
04 MOD
05 STO "Hour"
06 6
07 X≤Y?
08 +/-
09 SIGN
10 180
11 ×
12 30
13 RCL× ST Z
14 +
15 120
16 ×
17 11
18 ÷
19 3600
20 ÷
21 →HMS
22 +
23 RCL "Hour"
24 11
25 ÷
26 →HMS
27 RCL+ "Hour"
28 END

So hands (past "the" "Hour") are either on top of each other, or one is a prolongation of the other at the times in X and Y of HP42S or DM42 (if stack arrangement fits HP42's) running the program with "Hour" in X.

Thanks and sorry for the ambiguity in my first post, hope now it's clearer Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Clock Hands Challenge - RMollov - 03-02-2019, 02:47 AM
RE: Clock Hands Challenge - Dieter - 03-05-2019, 07:17 PM
RE: Clock Hands Challenge - rprosperi - 03-05-2019, 11:29 PM
RE: Clock Hands Challenge - rprosperi - 03-06-2019, 02:43 AM
RE: Clock Hands Challenge - RMollov - 03-06-2019 07:50 AM
RE: Clock Hands Challenge - ijabbott - 03-06-2019, 05:57 PM
RE: Clock Hands Challenge - Thomas Okken - 03-06-2019, 06:40 PM
RE: Clock Hands Challenge - ijabbott - 03-05-2019, 10:16 PM
RE: Clock Hands Challenge - Thomas Klemm - 03-05-2019, 10:52 PM
RE: Clock Hands Challenge - Thomas Klemm - 03-06-2019, 07:28 PM
RE: Clock Hands Challenge - RMollov - 03-07-2019, 07:21 AM
RE: Clock Hands Challenge - xerxes - 03-06-2019, 10:03 PM
RE: Clock Hands Challenge - Joe Horn - 03-06-2019, 11:55 PM
RE: Clock Hands Challenge - xerxes - 03-07-2019, 02:19 PM
RE: Clock Hands Challenge - RMollov - 03-08-2019, 03:30 AM



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