Skip to main content
added 15 characters in body
Source Link
orlp
  • 39.2k
  • 7
  • 81
  • 195

Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome or Firefox on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome or Firefox on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Kolomogorov complexity should apply here.
Source Link
Downgoat
  • 29.1k
  • 6
  • 84
  • 155

Write a piece of JavascriptJavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Write a piece of Javascript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].

As a reference, your code must be functionally equal to the following:

var fib = [], a = 1, b = 1;
for (var _ = 0; _ < 50; _++) {
    fib.push(a);
    var t = a; a = b; b = t + a;
}
alert(fib);

You may not assume any content on the webpage - your program will be run in the console on about:blank. Similarly, you may not 'cheat' and store any settings in cookies, settings or other data. Your solution must work on any fresh install of the latest Google Chrome on any OS. When in doubt, try to remain as portable as possible.


Smallest source code in bytes wins.

Tweeted twitter.com/#!/StackCodeGolf/status/635583441086586880
edited title
Source Link
orlp
  • 39.2k
  • 7
  • 81
  • 195
Loading
Source Link
orlp
  • 39.2k
  • 7
  • 81
  • 195
Loading