General FizzBuzz: Difference between revisions

m
m (→‎{{header|Tailspin}}: syntax update)
Line 2,980:
<lang tailspin>
def input: {N: 110, words: [ { mod: 3, word: 'Fizz' }, { mod: 5, word: 'Buzz'}, {mod:7, word: 'Baxx'}]};
 
templates sayWords
def i: $;
templates maybeSay
def word: $.word;
$i mod $.mod -> \(<=0> $word !\) !
end maybeSay
$input.words... -> maybeSay !
end sayWords
 
[ 1..$input.N -> '$->sayWords;' ] -> \[i](<''> $i ! <> $ !\) -> '$;
' -> !OUT::write
</lang>
Anonymous user