Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
items := [1,5,4,9,3,4]
|
||||
for i, v in SleepSort(items)
|
||||
result .= v ", "
|
||||
MsgBox, 262144, , % result := "[" Trim(result, ", ") "]"
|
||||
return
|
||||
|
||||
SleepSort(items){
|
||||
global Sorted := []
|
||||
slp := 50
|
||||
for i, v in items{
|
||||
fn := Func("PushFn").Bind(v)
|
||||
SetTimer, %fn%, % v * -slp
|
||||
}
|
||||
Sleep % Max(items*) * slp
|
||||
return Sorted
|
||||
}
|
||||
|
||||
PushFn(v){
|
||||
global Sorted
|
||||
Sorted.Push(v)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue