Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
import "random" for Random
|
||||
import "/sort" for Sort
|
||||
|
||||
var bogoSort = Fn.new { |a|
|
||||
var rand = Random.new()
|
||||
while (!Sort.isSorted(a)) rand.shuffle(a)
|
||||
}
|
||||
|
||||
var a = [31, 41, 59, 26, 53, 58, 97, 93, 23, 84]
|
||||
System.print("Before: %(a)")
|
||||
bogoSort.call(a)
|
||||
System.print("After : %(a)")
|
||||
Loading…
Add table
Add a link
Reference in a new issue