McNuggets problem: Difference between revisions
Content added Content deleted
m (→{{header|RPL}}: added forgotten header) |
(→{{header|RPL}}: direct Go traduction + tweak) |
||
Line 2,419: | Line 2,419: | ||
« → limit |
« → limit |
||
« { } limit 1 + + 0 CON |
« { } 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 limit '''FOR''' s |
0 limit '''FOR''' s |
||
s limit '''FOR''' n |
s limit '''FOR''' n |
||
Line 2,426: | Line 2,441: | ||
9 '''STEP''' |
9 '''STEP''' |
||
6 '''STEP''' |
6 '''STEP''' |
||
⚫ | |||
0 POS limit SWAP - 1 + |
0 POS limit SWAP - 1 + |
||
» » '<span style="color:blue">MCNUGTS</span>' STO |
» » '<span style="color:blue">MCNUGTS</span>' STO |