Pseudo-random numbers/Middle-square method: Difference between revisions

Content added Content deleted
Line 213: Line 213:
=={{header|Amazing Hopper}}==
=={{header|Amazing Hopper}}==
Flavour BASICO.
Flavour BASICO.
Version 1:
<p>Version 1:</p>
<syntaxhighlight lang="c">
<syntaxhighlight lang="c">
#include <basico.h>
#include <basico.h>
Line 233: Line 233:
432883
432883
</pre>
</pre>
Version 2:
<p>Version 2:</p>
<syntaxhighlight lang="c">
<syntaxhighlight lang="c">
#include <basico.h>
#include <basico.h>
Line 241: Line 241:
iterar grupo( --i, i, #( s = int(s ^2 / 1000 % 1000000) ) \
iterar grupo( --i, i, #( s = int(s ^2 / 1000 % 1000000) ) \
s, NL, imprimir )
s, NL, imprimir )
terminar
</syntaxhighlight>
{{out}}
<pre>
idem.
</pre>
<p>Version 3:</p>
<syntaxhighlight lang="c">
#include <basico.h>

algoritmo
s=675248, i=5
iterar grupo( --i, i, #( int(s ^2 / 1000 % 1000000) ) \
---copiar en 's'---, NL, imprimir )
terminar
terminar
</syntaxhighlight>
</syntaxhighlight>