Sattolo cycle: Difference between revisions

Content added Content deleted
(→‎{{header|BQN}}: Switch to fold-based implementation)
m (→‎{{header|R}}: Syntax highlighting.)
Line 1,633: Line 1,633:
=={{header|R}}==
=={{header|R}}==
Basically identical to https://rosettacode.org/wiki/Knuth_shuffle#Short_version We've only changed an i to an i-1, changed the function names, and added the [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] test.
Basically identical to https://rosettacode.org/wiki/Knuth_shuffle#Short_version We've only changed an i to an i-1, changed the function names, and added the [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] test.
<lang r>sattolo<-function(vec)
<lang rsplus>sattolo<-function(vec)
{
{
last<-length(vec)
last<-length(vec)