Add langs Cherrycake and Insitux
This commit is contained in:
parent
633b36288a
commit
9817d9b99b
36 changed files with 132 additions and 0 deletions
20
Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake
Normal file
20
Task/FizzBuzz/Cherrycake/fizzbuzz.cherrycake
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# 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();
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue