Anonymous user
Magic squares of doubly even order: Difference between revisions
Magic squares of doubly even order (view source)
Revision as of 11:50, 25 January 2024
, 3 months ago→{{header|Elena}}
imported>Arakov |
|||
(One intermediate revision by one other user not shown) | |||
Line 1,197:
{
if(n < 4 || n.mod(4) != 0)
{ InvalidArgumentException.new
int bits := 09669h;
Line 1,205:
var result := IntMatrix.allocate(n,n);
int i := 0;
for (int r := 0
{
for(int c := 0
{
int bitPos := c / mult + (r / mult) * 4;
Line 3,062:
{{trans|Kotlin}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="
var magicSquareDoublyEven = Fn.new { |n|
|