Pseudo-random numbers/Middle-square method: Difference between revisions
Content added Content deleted
Jazzedpineda (talk | contribs) (Replace Wikipedia link with template) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 30: | Line 30: | ||
* Show your output here, on this page. |
* Show your output here, on this page. |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<syntaxhighlight lang="11l"> |
|||
F random() |
|||
V :seed = 675248 |
|||
:seed = Int(String(Int64(:seed) ^ 2).zfill(12)[3.<9]) |
|||
R :seed |
|||
L 5 |
|||
print(random()) |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
959861 |
|||
333139 |
|||
981593 |
|||
524817 |
|||
432883 |
|||
</pre> |
|||
=={{header|AArch64 Assembly}}== |
=={{header|AArch64 Assembly}}== |
||
Line 122: | Line 144: | ||
432883 |
432883 |
||
</pre> |
</pre> |
||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO; |
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO; |