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

Published on 12 May 2024 09:40 PM

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

Source code in the xlisp programming language

(defun fizzbuzz ()
    (defun fizzb (x y)
        (display (cond
            ((= (mod x 3) (mod x 5) 0) "FizzBuzz")
            ((= (mod x 3) 0) "Fizz")
            ((= (mod x 5) 0) "Buzz")
            (t x)))
        (newline)
        (if (< x y)
            (fizzb (+ x 1) y)))
    (fizzb 1 100))

(fizzbuzz)

  

You may also check:How to resolve the algorithm Sieve of Eratosthenes step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Sorting algorithms/Bead sort step by step in the Seed7 programming language
You may also check:How to resolve the algorithm Fibonacci sequence step by step in the IDL programming language
You may also check:How to resolve the algorithm Map range step by step in the Amazing Hopper programming language
You may also check:How to resolve the algorithm Sequence of primorial primes step by step in the Sidef programming language