Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -1,6 +1,6 @@
|
|||
proc shuffle . a[] .
|
||||
for i = len a[] downto 2
|
||||
r = random i
|
||||
r = randint i
|
||||
swap a[r] a[i]
|
||||
.
|
||||
.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ extension randomOp
|
|||
{
|
||||
var max := self.Length;
|
||||
|
||||
for(int i := 0, i < max, i += 1)
|
||||
for(int i := 0; i < max; i += 1)
|
||||
{
|
||||
var j := randomGenerator.nextInt(i,max);
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ extension randomOp
|
|||
|
||||
public program()
|
||||
{
|
||||
var a := Array.allocate:MAX.populate:(i => i );
|
||||
var a := Array.allocate(MAX).populate::(i => i );
|
||||
|
||||
console.printLine(a.randomize())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue