Spiral matrix: Difference between revisions
m
→{{header|RPL}}: simplified code
m (→{{header|RPL}}: comments) |
m (→{{header|RPL}}: simplified code) |
||
Line 4,922:
{{works with|RPL|HP48-R}}
« { 0 1 } → n step
« { 1 1 } n DUP 2 →LIST -1 CON <span style="color:grey">@ empty cell = -1</span>
0 n SQ 1 - '''FOR''' j
OVER j PUT
DUP2 SWAP step ADD
'''IF IFERR''' GET '''THEN''' DROP2 1 '''ELSE''' -1 ≠ '''END'''
'''THEN''' step
SWAP step ADD SWAP
'''NEXT'''
|