Jump to content

Random Latin squares: Difference between revisions

m
Line 451:
 
=={{header|zkl}}==
<lang zkl>fcn randomLatinSquare(n,symbols=[1..]){ //--> list of lists
if(n<=0) return(T);
square,syms := List(), symbols.walker().walk(n);
Line 458:
T.zip(square.shuffle().xplode()).shuffle();
}
fcn rls2String(matrixsquare){ matrixsquare.apply("concat"," ").concat("\n") }</lang>
<lang zkl>foreach n in (T(1,2,5)){ randomLatinSquare(n) : rls2String(_).println("\n") }
randomLatinSquare(5, ["A".."Z"]) : rls2String(_).println("\n");
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.