3 ms·
There's a blog post about FizzBuzzBazz (note the third value) in LiveScript, I posted a comment there, with J version[1], looking like this: fu=:(3&|),(5&|
by klibertp 10y ago
There's a blog post about FizzBuzzBazz (note the third value) in LiveScript, I posted a comment there, with J version[1], looking like this:
fu=:(3&|),(5&|),:(7&|)
g1=:(,&'zz')"1>;:'Fi Bu Ba'
((0=fu i.101){"1(3 1$<''),.(,.<"1 g1)),<"0 i.101
Well, what else can I say? J is really fun to play with.
It's also not true that it cannot be maintainable or readable. J crazy parsing rules and other language features make it very flexible, on the level of Lisp, TCL, PERL, Smalltalk or Io. This means it can be a completely unreadable mess, as well as a readable and maintainable code, depending on who writes it. I made an attempt at writing readable - articulate - J: https://klibert.pl/posts/literate_j.html https://klibert.pl/posts/literate_j.html
[1] http://livescript.net/blog/fizzbuzzbazz.html#comment-1145818066 http://livescript.net/blog/fizzbuzzbazz.html#comment-1145818...
- kazinator 10y agoThat cryptic code, ironically, doesn't appear significantly shorter, if at all, than the FizzBuzz solutions in some ordinary, readable languages. What's the point?