How to resolve the algorithm Random number generator (included) step by step in the EchoLisp programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Random number generator (included) step by step in the EchoLisp programming language

Table of Contents

Problem Statement

The task is to: Note: the task is not to create an RNG, but to report on the languages in-built RNG that would be the most likely RNG used. The main types of pseudo-random number generator (PRNG) that are in use are the Linear Congruential Generator (LCG), and the Generalized Feedback Shift Register (GFSR), (of which the Mersenne twister generator is a subclass). The last main type is where the output of one of the previous ones (typically a Mersenne twister) is fed through a cryptographic hash function to maximize unpredictability of individual bits. Note that neither LCGs nor GFSRs should be used for the most demanding applications (cryptography) without additional steps.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Random number generator (included) step by step in the EchoLisp programming language

Source code in the echolisp programming language

(random-seed "albert")
(random) → 0.9672510261922906 ; random float in [0 ... 1[
(random 1000)  → 726  ; random integer in [0 ... 1000 [
(random -1000) → -936 ; random integer in ]-1000 1000[

(lib 'bigint)
(random 1e200) → 48635656441292641677...3917639734865662239925...9490799697903133046309616766848265781368


  

You may also check:How to resolve the algorithm Arithmetic/Complex step by step in the ooRexx programming language
You may also check:How to resolve the algorithm HTTPS/Authenticated step by step in the PowerShell programming language
You may also check:How to resolve the algorithm Hello world/Text step by step in the Gentee programming language
You may also check:How to resolve the algorithm Nautical bell step by step in the REXX programming language
You may also check:How to resolve the algorithm Loops/Increment loop index within loop body step by step in the AArch64 Assembly programming language