Knuth shuffle: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add SETL) |
imported>Arakov |
||
Line 1,891: | Line 1,891: | ||
var max := self.Length; |
var max := self.Length; |
||
for(int i := 0 |
for(int i := 0; i < max; i += 1) |
||
{ |
{ |
||
var j := randomGenerator.nextInt(i,max); |
var j := randomGenerator.nextInt(i,max); |
||
Line 1,904: | Line 1,904: | ||
public program() |
public program() |
||
{ |
{ |
||
var a := Array.allocate |
var a := Array.allocate(MAX).populate::(i => i ); |
||
console.printLine(a.randomize()) |
console.printLine(a.randomize()) |