(10-05-2018 12:00 AM)Joe Horn Wrote: Craig Bladow's RPN contest entry can be downloaded from HERE.
My observations about Craig's entry:
- Program name: "ELEGANT". Clever.
- Built-in instructions. Very nice!
- Uses MOD algorithm (earns two "elegance" points).
- Nicely formatted outputs.
- Unfortunately gets wrong answers. Input 8/19/1955, outputs 12/07/2018, should be 10/22/2018.
Thank you for judging this, Joe! I've had a chance to review my solution and it does get right answers, just not all of them!
I misinterpreted the contest description and implemented a solution that only reports days with one +100 and one -100 extrema. 10/22/2018 has two +100 extrema so it wasn't reported by my program.
The following is a corrected program:
Code:
LBL "ELEGANT"
"BY CRAIG BLADOW"
"XEQ ELEGANT OR"
"PRESS A IN USER"
"MODE, ENTER"
"BDAY PRESS R/S"
"BEEP, DISPLAYS"
"WHEN EXT FOUND"
"PRESS R/S FOR"
"EACH BRTHYM"
"R/S FOR NEXT"
"EXTREMA DAY"
"CHECKS EACH DAY"
"FOR +/- EXT"
"USES NO TRIG"
"CHECKS DAY MOD"
"PERIOD EQUAL"
"6,7,8 FOR +EXT"
"17,21,25 FOR"
"-EXT"
LBL A
"BDY?:MM.DDYYYY"
PROMPT
STO 11
DATE
DDAYS
STO 10
23
STO 00
28
STO 01
33
STO 02
LBL 00
0
STO 12
1
STO+ 10
.002
STO 09
LBL 01
RCL 10
RCL IND 09
MOD
RCL 09
INT
6
+
X=Y?
XEQ 06
ISG 09
GTO 01
LBL 02
.002
STO 09
LBL 03
RCL 10
RCL IND 09
MOD
RCL 09
INT
4
*
17
+
X=Y?
XEQ 06
GTO 04
ISG 09
GTO 03
2
RCL 12
X<Y?
GTO 00
LBL 04
RCL 11
RCL 10
DATE+
FIX 06
CLA
ADATE
AVIEW
BEEP
STOP
FIX 00
CF 29
"PHYSICAL: "
23
XEQ 05
ARCL ST X
AVIEW
STOP
"EMOTIONAL: "
28
XEQ 05
ARCL ST X
AVIEW
STOP
"INTELLECTUAL: "
33
XEQ 05
ARCL ST X
AVIEW
SF 29
STOP
GTO 00
LBL 05
RCL 10
X<>Y
÷
360
*
SIN
100
*
RND
RTN
LBL 06
1
ST+ 12
RTN
END