How to resolve the algorithm Loops/Break step by step in the min programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Loops/Break step by step in the min programming language
Table of Contents
Problem Statement
Show a loop which prints random numbers (each number newly generated each loop) from 0 to 19 (inclusive).
If a number is 10, stop the loop after printing it, and do not generate any further numbers.
Otherwise, generate and print a second random number before restarting the loop.
If the number 10 is never generated as the first number in a loop, loop forever.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Loops/Break step by step in the min programming language
Source code in the min programming language
randomize
(19 random puts 10 ==) (19 random puts!) () () linrec
You may also check:How to resolve the algorithm Fermat numbers step by step in the Haskell programming language
You may also check:How to resolve the algorithm Factorial step by step in the C3 programming language
You may also check:How to resolve the algorithm Middle three digits step by step in the Quackery programming language
You may also check:How to resolve the algorithm Random numbers step by step in the Fantom programming language
You may also check:How to resolve the algorithm Generator/Exponential step by step in the PL/I programming language