Random Latin squares: Difference between revisions

Content added Content deleted
(→‎{{header|jq}}: add algorithm for uniform distribution)
(Latin Squares selected at random uniformly)
Line 1,670: Line 1,670:
</syntaxhighlight>
</syntaxhighlight>


===uniformly-random-latin-squares.jq===
===Latin Squares selected at random uniformly===
<syntaxhighlight lang=sh>
<syntaxhighlight lang=sh>
# Include the utilities e.g. by
# Include the utilities e.g. by
Line 1,727: Line 1,727:


# If the input is a positive integer, $n, generate and print an $n x $n Latin Square.
# If the input is a positive integer, $n, generate and print an $n x $n Latin Square.
# Otherwise, simply echo it.
# If it is not number, echo it.
def printLatinSquare:
def printLatinSquare:
if type == "number"
if type == "number"
Line 1,758: Line 1,758:
stats(4;5760)
stats(4;5760)
</syntaxhighlight>
</syntaxhighlight>

{{output}}
{{output}}
<pre>
<pre>