How to resolve the algorithm Loops/Do-while step by step in the REBOL programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Loops/Do-while step by step in the REBOL programming language

Table of Contents

Problem Statement

Start with a value at 0. Loop while value mod 6 is not equal to 0. Each time through the loop, add 1 to the value then print it. The loop must execute at least once.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Loops/Do-while step by step in the REBOL programming language

Source code in the rebol programming language

REBOL [
	Title: "Loop/While"
	URL: http://rosettacode.org/wiki/Loop/Do_While
]

; REBOL doesn't have a specific 'do/while' construct, but 'until' can
; be used to provide the same effect.

value: 0
until [
	value: value + 1
	print value

	0 = mod value 6
]

  

You may also check:How to resolve the algorithm Guess the number/With feedback (player) step by step in the Quackery programming language
You may also check:How to resolve the algorithm Write entire file step by step in the Julia programming language
You may also check:How to resolve the algorithm 100 doors step by step in the Oforth programming language
You may also check:How to resolve the algorithm Last letter-first letter step by step in the Delphi programming language
You may also check:How to resolve the algorithm Loops/Foreach step by step in the Swift programming language