Capture the flag - HP-12C programming contest « Next Oldest | Next Newest »

 ▼ x34 Member Posts: 114 Threads: 18 Joined: Jan 2011 02-11-2011, 12:01 PM There are at least two flags on HP-12C: BEG/END and D.MY/M.DY. What the fastest ways to get these flags values? (and shortest also). ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 02-11-2011, 12:59 PM 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. 2) 1.022 ENTER 1 CHS DATE INT 1 - x=0 will be true if mode was M.DY and will not if D.MY I make no claims that these are anywhere near optimal, but they work. ▼ x34 Member Posts: 114 Threads: 18 Joined: Jan 2011 02-11-2011, 03:06 PM 1) Being not acquainted with finance, is N "n" or "Nj"? 2) 14 steps, <5s in both modes. Wonderful! And unexpected (for me) VIEW/PSE effect. ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 02-11-2011, 03:09 PM Oops. N should be lowercase n. and an edit to the second set of instructions. Saves a step: 1.022 ENTER 1 CHS DATE LSTx - x=0 Edited: 11 Feb 2011, 3:11 p.m. ▼ x34 Member Posts: 114 Threads: 18 Joined: Jan 2011 02-11-2011, 03:17 PM 1) 11 steps. Less then 4 seconds!!! Das ist Fantastisch! My best was 15s with finance and three times in length (while destroying finance regs too). If finance regs (i use them only for polynomials) are destroyed, it could be used in the finishing part of any program to select output. ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 02-11-2011, 03:20 PM 1) May not be faster, but shorter: 0 FV 1 n 1 i 1 PV PMT FRC X=0? ▼ x34 Member Posts: 114 Threads: 18 Joined: Jan 2011 02-11-2011, 03:34 PM Gene, my HP12C says new program is actually a bit FASTER too :) Having read your articles on HP calcs for many years, I understand you are very experienced in programming them. Please, tell me if there are any more flags in HP-12C which could be used? Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 02-11-2011, 09:45 PM Quote: 1.022 ENTER 1 CHS DATE LSTx - x=0 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. ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 02-12-2011, 01:14 PM Oops. Shoudl have been: 1.022 ENTER 1 CHS DATE LSTx + x=0 ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 02-13-2011, 05:36 PM 0 FV 1 STO n STO i STO PV PMT 1 + X=0? ▼ Allen Senior Member Posts: 562 Threads: 27 Joined: Oct 2006 02-13-2011, 06:59 PM A very concise test! Well done, sir!

 Possibly Related Threads... Thread Author Replies Views Last Post HP 12C Platinum Programming v. Gold Face Dean Lewis 10 2,590 11-03-2013, 07:30 PM Last Post: Kimberly Thompson HHC 2013 programming contest winners Brian Walsh 52 9,020 09-26-2013, 11:39 PM Last Post: David Hayden HHC / HP Museum Programming Contest for RPN and RPL machines Gene Wright 18 4,425 09-22-2013, 09:39 AM Last Post: Miguel Toro HHC 2012 RPN Programming Contest - 10-Step Way-After-Nashville Solution Jeff O. 32 5,244 10-12-2012, 01:41 AM Last Post: Paul Dale Mini-challenge: HHC2012 RPL programming contest with larger input David Hayden 14 2,859 10-05-2012, 10:36 PM Last Post: David Hayden HHC 2012 RPN Programming Contest Gene Wright 73 10,625 09-28-2012, 12:43 PM Last Post: x34 HHC 2012 RPL Programming Contest Gene Wright 33 5,963 09-27-2012, 01:57 AM Last Post: Werner HP-67's Flag 3 to HP-41/42 Equivalent Matt Agajanian 2 989 03-29-2012, 06:29 AM Last Post: Dieter HP Forum HHC Programming contest idea / possible rules Gene Wright 30 4,981 09-26-2011, 08:07 AM Last Post: Gerson W. Barbosa HHC 2011 is 5 weeks away --- bring your 20b/30b to be flashed and the programming contest... Gene Wright 27 4,938 08-21-2011, 05:08 PM Last Post: gene wright

Forum Jump: