How to resolve the algorithm FizzBuzz step by step in the zkl programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm FizzBuzz step by step in the zkl programming language
Table of Contents
Problem Statement
Write a program that prints the integers from 1 to 100 (inclusive).
But:
The FizzBuzz problem was presented as the lowest level of comprehension required to illustrate adequacy.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm FizzBuzz step by step in the zkl programming language
Source code in the zkl programming language
foreach n in ([1..100]) {
if(n % 3 == 0) print("Fizz");
if(not (n%5)) "Buzz".print();
if(n%3 and n%5) print(n);
println();
}
fcn f(a,b,c){ a+b and a+b or c }
Walker.cycle("","","Fizz").zipWith(f,Walker.cycle("","","","","Buzz"),[1..])
.walk(100).concat("\n").println();
Walker.cycle(0,0,"Fizz",0,"Buzz","Fizz",0,0,"Fizz","Buzz",0,"Fizz",0,0,"FizzBuzz")
.zipWith(fcn(a,b){ a or b },[1..]).walk(100).concat("\n").println();
You may also check:How to resolve the algorithm Literals/String step by step in the Maple programming language
You may also check:How to resolve the algorithm Comments step by step in the Phix programming language
You may also check:How to resolve the algorithm Collections step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Mayan numerals step by step in the REXX programming language
You may also check:How to resolve the algorithm Increasing gaps between consecutive Niven numbers step by step in the Python programming language