phantomjs/examples/fibo.coffee

9 lines
224 B
CoffeeScript
Raw Normal View History

2011-04-22 19:39:51 +04:00
fibs = [0, 1]
f = ->
2011-05-29 16:21:25 +04:00
console.log fibs[fibs.length - 1]
fibs.push fibs[fibs.length - 1] + fibs[fibs.length - 2]
if fibs.length > 10
window.clearInterval ticker
phantom.exit()
2011-04-22 19:39:51 +04:00
ticker = window.setInterval(f, 300)