FizzBuzz: Difference between revisions

578 bytes added ,  10 months ago
Added the Cherrycake code example for FizzBuzz
(Added the Cherrycake code example for FizzBuzz)
Line 2,147:
=={{header|Chef}}==
See [[FizzBuzz/EsoLang]]
 
=={{header|Cherrycake}}==
<syntaxhighlight lang="cherrycake">
# Route with custom number of iterations
cached get ~/:n {
 
# Get the Number of Iterations from the URL Params
int n = req.params.n || 100
 
# Loop through each iteration
for (i in range(n)) {
 
if (((i % 2) == 0) && ((i % 3) == 0)) { res.write("FizzBuzz\n") continue }
if ((i % 2) == 0) { res.write("Fizz\n"); continue; }
if ((i % 3) == 0) { res.write("Buzz\n"); continue; }
res.write(i + "\n");
 
}
 
# Close the connection
res.end();
 
}
</syntaxhighlight>
 
=={{header|Clay}}==