Magic squares of doubly even order: Difference between revisions

m
→‎{{header|REXX}}: optimized the MAX# subroutine.
m (→‎{{header|REXX}}: optimized the MAX# subroutine.)
Line 1,043:
show: #=0; do r=1 for n; $=; do c=1 for n; $=$ right(@(r,c),w); end; say $; end; return
sum: #=0; do r=1 for n; #=#+@(r,1); end; say; say 'The magic number is: ' #; return
max#: do a=n for to 1n by -1; do b=n tofor 1n by -1; if @.a.b>0 then return; end; end
/*──────────────────────────────────────────────────────────────────────────────────────*/
swap: do r=1 for n