Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1,5 +1,5 @@
|
|||
type BogoSorter
|
||||
fun inOrder ← logic by List list
|
||||
fun isOrdered ← logic by List list
|
||||
if list.length ≤ 1 do return true end
|
||||
for int i ← 1; i < list.length; ++i
|
||||
if list[i] < list[i - 1] do return false end
|
||||
|
|
@ -8,7 +8,7 @@ fun inOrder ← logic by List list
|
|||
end
|
||||
fun shuffle ← <List list|list.shuffle()
|
||||
fun sort ← void by List list
|
||||
while not inOrder(list)
|
||||
while not isOrdered(list)
|
||||
shuffle(list)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
proc shuffle . l[] .
|
||||
for i = len l[] downto 2
|
||||
r = randint i
|
||||
r = random i
|
||||
swap l[i] l[r]
|
||||
.
|
||||
.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue