FizzBuzz: Difference between revisions

Content deleted Content added
Wodan58 (talk | contribs)
Wodan58 (talk | contribs)
Line 5,262: Line 5,262:


=={{header|Joy}}==
=={{header|Joy}}==
The following program first defines a function "out", which handles the Fizz / Buzz logic, and then loops from 1 to 100 mapping the function onto each number, and printing ("put") the output.
The following program first defines a function "out", that handles the Fizz / Buzz logic, and then loops from 1 to 100 mapping the function onto each number, and printing ("put") the output.
<syntaxhighlight lang=Joy>DEFINE out == [[[15 rem null] "FizzBuzz"]
<lang Joy>
DEFINE out == [[[15 rem null] "FizzBuzz"]
[[ 3 rem null] "Fizz"]
[[ 3 rem null] "Fizz"]
[[ 5 rem null] "Buzz"]
[]] cond
[[ 5 rem null] "Buzz"]
[putchars pop] [put] ifstring '\n putch.
[]] cond
[putchars pop] [put] ifstring '\n putch.


100 [] [out] primrec.</lang>
100 [] [out] primrec.</syntaxhighlight>


=={{header|jq}}==
=={{header|jq}}==