source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/sleepsort.coffee@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 499 bytes
Line 
1###
2Sort integers from the command line in a very ridiculous way: leveraging timeouts :P
3###
4
5system = require 'system'
6
7if system.args.length < 2
8 console.log "Usage: phantomjs sleepsort.coffee PUT YOUR INTEGERS HERE SEPARATED BY SPACES"
9 phantom.exit 1
10else
11 sortedCount = 0
12 args = Array.prototype.slice.call(system.args, 1)
13 for int in args
14 setTimeout (do (int) ->
15 ->
16 console.log int
17 ++sortedCount
18 phantom.exit() if sortedCount is args.length),
19 int
20
Note: See TracBrowser for help on using the repository browser.