3 ms·
I think characters are a better count of brevity. Consider the archetypical shell is 80 chars wide, so there exists a direct translation to 'real' lines of cod
by api_or_ipa 11y ago
I think characters are a better count of brevity. Consider the archetypical shell is 80 chars wide, so there exists a direct translation to 'real' lines of code.
See my 52 char fizz buzz in js:
https://github.com/codeocelot/fizzbuzz_oneliner/ https://github.com/codeocelot/fizzbuzz_oneliner/
- nvader 11y agoIsn't the rest of the problem of fizzbuzz to then map your oneliner over the range 1 to 100, and print each result on a new line?
- nvader 11y agoSo, https://gist.github.com/danverbraganza/8447acc70ad08c92d4fd https://gist.github.com/danverbraganza/8447acc70ad08c92d4fd has an uglified version of the same code, shortening identifiers, removing extraneous whitespace, and (!) replacing bool(x) with not x to save 2 characters. That's a good first stab at it, but it can definitely be smaller, esp. if you're willing to add more lines (which I'm not). Happy hacking!