McNuggets problem: Difference between revisions

→‎{{header|RPL}}: direct Go traduction + tweak
m (→‎{{header|RPL}}: added forgotten header)
(→‎{{header|RPL}}: direct Go traduction + tweak)
Line 2,419:
« → limit
« { } limit 1 + + 0 CON
0 limit '''FOR''' s
s limit '''FOR''' n
n limit '''FOR''' t
t 1 + 1 PUT
20 '''STEP'''
9 '''STEP'''
6 '''STEP'''
limit
'''WHILE''' DUP2 GET '''REPEAT''' 1 - '''END'''
1 + SWAP DROP
» » '<span style="color:blue">MCNUGTS</span>' STO
We can tweak a little bit the above traduction, to benefit from latest efficient built-in functions:
{{works with|HP|49}}
« → limit
« 0 ARRY→limit 1 GETNDUPN →LIST
0 limit '''FOR''' s
s limit '''FOR''' n
Line 2,426 ⟶ 2,441:
9 '''STEP'''
6 '''STEP'''
ARRY→ 1 GET →LIST
0 POS limit SWAP - 1 +
» » '<span style="color:blue">MCNUGTS</span>' STO
1,150

edits