How to resolve the algorithm FizzBuzz step by step in the Shale programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm FizzBuzz step by step in the Shale 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 Shale programming language
Source code in the shale programming language
#!/usr/local/bin/shale
string library
r var
i var
i 1 =
{ i 100 <= } {
r "" =
i 3 % 0 == { r r "fizz" concat string::() = } ifthen
i 5 % 0 == { r r "buzz" concat string::() = } ifthen
r "" equals string::() { i } { r } if i "%3d: %p\n" printf
i++
} while
You may also check:How to resolve the algorithm Sieve of Eratosthenes step by step in the Tailspin programming language
You may also check:How to resolve the algorithm Knapsack problem/0-1 step by step in the Sidef programming language
You may also check:How to resolve the algorithm Quine step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Mutex step by step in the Shale programming language
You may also check:How to resolve the algorithm Logistic curve fitting in epidemiology step by step in the Go programming language