2 ms·
http://rosettacode.org/wiki/Io http://rosettacode.org/wiki/Io Everything is better with code samples! One of the FizzBuzz implementations is particularly cool:
by scythe 15y ago
http://rosettacode.org/wiki/Io http://rosettacode.org/wiki/Io
Everything is better with code samples! One of the FizzBuzz implementations is particularly cool:
for (n, 1, 100,
fb := list (
if (n % 3 == 0, "Fizz"),
if (n % 5 == 0, "Buzz")) select (isTrue)
if (fb isEmpty, n, fb join) println
)
- draegtun 15y agoBlush! I contributed that bit of Io FizzBuzz to Rosettacode :) I originally posted that here on HN: http://news.ycombinator.com/item?id=1539295 http://news.ycombinator.com/item?id=1539295
- draegtun 15y agoNot easily found but the Io website also comes with some great code samples: http://www.iolanguage.com/about/samplecode/ http://www.iolanguage.com/about/samplecode/