A Latin square of size n is an arrangement of n symbols in an n-by-n square in such a way that each row and column has each symbol appearing exactly once.

A randomised Latin square generates random configurations of the symbols for any given n.

Example n=4 randomised Latin square

0 2 3 1
2 1 0 3
3 0 1 2
1 3 2 0
Task

 Create a function/routine/procedure/method/... that given n generates a randomised Latin square of size n.
 Use the function to generate and show here, two randomly generated squares of size 5.
Note
 
Strict Uniformity in the random generation is a hard problem and not a requirement of the task.

Reference

 Wikipedia: Latin square
 OEIS: A002860


latinSquare: function [n][
    square: new []
    variants: shuffle permutate 0..n-1
    while -> n > size square [
        row: sample variants
        'square ++ @[row]
        filter 'variants 'variant [
            reject: false
            loop.with:'i variant 'col [
                if col = row\[i] ->
                    reject: true
            ]
            reject
        ]
    ]
    return square
]
 
loop 2 'x [
    ls: latinSquare 5
    loop ls 'row ->
        print row
    print "---------"
]