3 ms·
That's a good start! I'm not exactly great with array langauges myself, but I think it's simpler to fill an array with □"Fizz", one with □"Buzz", one with □"Fiz
by vanderZwan 3y ago
That's a good start! I'm not exactly great with array langauges myself, but I think it's simpler to fill an array with □"Fizz", one with □"Buzz", one with □"FizzBuzz", then create another indexing array and use pick:
⍉[∵(□$"_"+1)⇡100
[⍥.99□"Fizz"]
[⍥.99□"Buzz"]
[⍥.99□"FizzBuzz"]]
+∵(×2=0◿5+1)⇡100 ∵(=0◿3+1)⇡100
≡⊡
⍉
There are probably a few more simplifications experienced array programmers can apply.
- ivanjermakov 3y agoSmart!
- zellyn 3y agohttps://code.jsoftware.com/wiki/NYCJUG/FizzBuzz https://code.jsoftware.com/wiki/NYCJUG/FizzBuzz gives a solution in J of: FB=:((0 i.~15 3 5|]){::'FizzBuzz';'Fizz';'Buzz';":)"0 FB i.100 I unfortunately don't know enough J or Uiua to be able to translate that Perhaps someone else can step in!
- vanderZwan 3y agoLuckily the Uiua language creator stepped in to help us out :)