Jump to content

Magic squares of doubly even order: Difference between revisions

m
→‎{{header|REXX}}: changed wording in the REXX section header.
m (→‎{{header|REXX}}: optimized the MAX# subroutine.)
m (→‎{{header|REXX}}: changed wording in the REXX section header.)
Line 1,023:
<!-- I couldn't figure out the other code's bit shifting and bit ANDing, so I wrote my own algorithm. -->
 
"Marked" numbers indicate that those&nbsp; (sequentiallyvia generated)the numbers&nbsp; don't''diag''' get&nbsp; swappedsubroutine) &nbsp; (andindicate thusly,that staythose in(sequentially placegenerated) innumbers thedon't magic square).get
<br>swapped &nbsp; (and thusly, stay in place in the magic square).
<lang rexx>/*REXX program constructs a magic square of doubly even sides (a size divisible by 4).*/
n=8; s=n%4; L=n%2-s+1; w=length(n**2) /*size; small sq; low middle; # width*/
Cookies help us deliver our services. By using our services, you agree to our use of cookies.