28 lines
417 B
Text
28 lines
417 B
Text
import system'routines;
|
|
import extensions;
|
|
|
|
const int MAX = 10;
|
|
|
|
extension randomOp
|
|
{
|
|
randomize()
|
|
{
|
|
var max := self.Length;
|
|
|
|
for(int i := 0; i < max; i += 1)
|
|
{
|
|
var j := Random.nextInt(i,max);
|
|
|
|
self.exchange(i,j)
|
|
};
|
|
|
|
^ self
|
|
}
|
|
}
|
|
|
|
public Program()
|
|
{
|
|
var a := Array.allocate(MAX).populate::(i => i );
|
|
|
|
Console.printLine(a.randomize())
|
|
}
|