Magic squares of doubly even order: Difference between revisions

m
→‎{{header|Rust}}: Optimization of width
m (→‎{{header|Rust}}: Optimization of width)
Line 2,174:
let mc = (n * n + 1) * n / 2;
println!("Magic constant: {}\n", mc);
let width = mc(n * n).to_string().len() + 1;
let bits = 0b1001_0110_0110_1001u32;
let size = n * n;
Line 2,200:
Magic constant: 260
 
1 2 62 61 60 59 7 8
9 10 54 53 52 51 15 16
48 47 19 20 21 22 42 41
40 39 27 28 29 30 34 33
32 31 35 36 37 38 26 25
24 23 43 44 45 46 18 17
49 50 14 13 12 11 55 56
57 58 6 5 4 3 63 64
</pre>
 
=={{header|Scala}}==
{{Out}}Best seen running in your browser either by [https://scalafiddle.io/sf/bdTcGF3/0 ScalaFiddle (ES aka JavaScript, non JVM)] or [https://scastie.scala-lang.org/gLhkwHHlRO6rPXg9U7MDzg Scastie (remote JVM)].
Anonymous user