![]() |
Capture the flag - HP-12C programming contest - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Capture the flag - HP-12C programming contest (/thread-178675.html) |
Capture the flag - HP-12C programming contest - x34 - 02-11-2011 There are at least two flags on HP-12C: BEG/END and D.MY/M.DY.
Re: Capture the flag - HP-12C programming contest - Gene Wright - 02-11-2011 1) 10 second idea. Destroys values in financial registers. 0 FV 1 N 1 i 1 PV PMT 1 + X=0? If condition true then it was in BEG mode, otherwise END mode.
1.022 ENTER 1 CHS DATE INT 1 - x=0 will be true if mode was M.DY and will not if D.MY
Re: Capture the flag - HP-12C programming contest - x34 - 02-11-2011 1) Being not acquainted with finance, is N "n" or "Nj"? Re: Capture the flag - HP-12C programming contest - Gene Wright - 02-11-2011 Oops. N should be lowercase n. and an edit to the second set of instructions. Saves a step:
Edited: 11 Feb 2011, 3:11 p.m.
Re: Capture the flag - HP-12C programming contest - x34 - 02-11-2011 1) 11 steps.
Re: Capture the flag - HP-12C programming contest - Gene Wright - 02-11-2011 1) May not be faster, but shorter:
0 FV 1 n 1 i 1 PV PMT FRC X=0?
Re: Capture the flag - HP-12C programming contest - x34 - 02-11-2011 Gene, my HP12C says new program is actually a bit FASTER too :) Re: Capture the flag - HP-12C programming contest - Gerson W. Barbosa - 02-11-2011
Quote: Have I misunderstood something here? This returns 2.012 in M.DY mode and 32.012 in D.MY mode. That is, false for both modes. 1.012 ENTER 1 DATE INTG 1 - x=0 will return 0 and 1, respectively. Same number of steps though.
Re: Capture the flag - HP-12C programming contest - Gene Wright - 02-12-2011 Oops. Shoudl have been:
1.022 ENTER 1 CHS DATE LSTx + x=0
Fewer steps - Gene Wright - 02-13-2011 0 FV 1 STO n STO i STO PV PMT 1 + X=0?
Re: Fewer steps - Allen - 02-13-2011 A very concise test! Well done, sir!
|