How to resolve the algorithm FizzBuzz step by step in the XMIDAS programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm FizzBuzz step by step in the XMIDAS 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 XMIDAS programming language

Source code in the xmidas programming language

startmacro
  loop 100 count
    calc/quiet three ^count 3 modulo
    calc/quiet five ^count 5 modulo
    if ^three eq 0 and ^five eq 0
      say "fizzbuzz"
    elseif ^three eq 0
      say "fizz"
    elseif ^five eq 0
      say "buzz"
    else
      say ^count
    endif
  endloop
endmacro

  

You may also check:How to resolve the algorithm Loop over multiple arrays simultaneously step by step in the Beads programming language
You may also check:How to resolve the algorithm Sum of squares step by step in the Smalltalk programming language
You may also check:How to resolve the algorithm LZW compression step by step in the Haskell programming language
You may also check:How to resolve the algorithm Deconvolution/2D+ step by step in the Julia programming language
You may also check:How to resolve the algorithm Array length step by step in the Zoea programming language