Jump to content

Generate random numbers without repeating a value: Difference between revisions

m
m (→‎{{header|RPL}}: improved code)
m (→‎{{header|RPL}}: Comments)
Line 1,029:
'''Stand-alone implementation'''
≪ 0 → n r
≪ 1 n '''FOR''' j j '''NEXT''' <span style="color:grey">@ fill stack with 1, 2,..n</span>
1 n '''START'''
n 1 - RAND * CEIL 1 + 'r' STO
r ROLL SWAP r ROLLD <span style="color:grey">@ swap 2 stack levels randomly, n times</span>
n ROLL
'''NEXT'''
1,150

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.