mirror of https://github.com/coolaj86/fizzbuzz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
283 B
16 lines
283 B
#!/usr/bin/env node
|
|
"use strict";
|
|
var sys = require('sys');
|
|
(function () {
|
|
var seq = [];
|
|
function fibonacci(a, b) {
|
|
seq.push(a);
|
|
if (a >= 100) {
|
|
seq.push(b);
|
|
return;
|
|
}
|
|
fibonacci(b, a+b);
|
|
}
|
|
fibonacci(0,1);
|
|
sys.print(seq.join(', ') + "\n");
|
|
}());
|
|
|