Pseudo-random numbers/Middle-square method: Difference between revisions
Content added Content deleted
m (→{{header|Quackery}}: extra commentary) |
m (→{{header|Quackery}}: Added some more commentary) |
||
Line 722: | Line 722: | ||
As specified in task pseudo-code. |
As specified in task pseudo-code. |
||
(Adding one zero at a time irks me. If I wasn't sticking strictly to the pseudo-code I'd have written <code>12 over size - char 0 swap of join</code> instead of the <code>while</code> loop. |
(Adding one zero at a time irks me. If I wasn't sticking strictly to the pseudo-code I'd have written <code>12 over size - char 0 swap of join</code> instead of the <code>while</code> loop – i.e. calculate how many 0s are required and add that many in one hit. |
||
Or even "Add more than enough 0s and then truncate. <code>$ "000000000000" join 12 split drop</code>.) |
|||
<syntaxhighlight lang="Quackery"> [ dip [ split nip ] |
<syntaxhighlight lang="Quackery"> [ dip [ split nip ] |