RosettaCodeData/Task/FizzBuzz/Mathematica/fizzbuzz-3.math

8 lines
163 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
SetAttributes[f,Listable]
f[n_ /; Mod[n, 15] == 0] := "FizzBuzz";
f[n_ /; Mod[n, 3] == 0] := "Fizz";
f[n_ /; Mod[n, 5] == 0] := "Buzz";
f[n_] := n;
f[Range[100]]