Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
after = (s, f) -> setTimeout f, s*1000
|
||||
|
||||
# Setting Computer Science back at least a century, maybe more,
|
||||
# this algorithm sorts integers using a highly parallelized algorithm.
|
||||
sleep_sort = (arr) ->
|
||||
for n in arr
|
||||
do (n) -> after n, -> console.log n
|
||||
|
||||
do ->
|
||||
input = (parseInt(arg) for arg in process.argv[2...])
|
||||
sleep_sort input
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
> time coffee sleep_sort.coffee 5, 1, 3, 4, 2
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
|
||||
real 0m5.184s
|
||||
user 0m0.147s
|
||||
sys 0m0.024s
|
||||
Loading…
Add table
Add a link
Reference in a new issue