Created
September 4, 2012 07:23
-
-
Save tiye/3617971 to your computer and use it in GitHub Desktop.
Scirpus fabonacci demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| = a (# 1 24 53 45 3 4 56 578 89 56 56) | |
| = sort | |
| -> (start end list) | |
| if (>= end a.length) (<- list) | |
| if (>= start end) | |
| <- (sort 0 (+ end 1) list) | |
| do | |
| = small (. list start) | |
| = big (. list (+ start 1)) | |
| if (> small big) | |
| do | |
| = t small | |
| = small big | |
| = big t | |
| = (. list start) small | |
| = (. list (+ start 1)) big | |
| <- (sort (+ start 1) end list) | |
| console.log (sort 0 0 a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| = f | |
| -> (n) | |
| if (< n 2) | |
| <- 1 | |
| <- | |
| + | |
| f (- n 1) | |
| f (- n 2) | |
| . console (log (f 20)) | |
| -- 看到这种代码你会不会疯掉? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| = http (require 'http') | |
| = handler | |
| -> (req res) (res.end 'nodejs demo') | |
| = app | |
| http.createServer handler | |
| app.listen 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment