Skip to main content
added 70 characters in body
Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

Wolfram Language (Mathematica), 263284 bytes, score ~150000 on TIO

Fixed a bug thanks to @att.

With[{size = 2 Ceiling[Sqrt@#/2.7] + 3}, 
   PrintWriteString[$Output, ##] & @@ 
    FixedPoint[
     BitAnd[#, 3] + 
       With[{q = BitShiftRight[#, 2]}, 
        Sum[RotateLeft[q, d], {d, {1, -1, size, -size}}]] &, 
     CenterArray[#, size^2]]] &@ToExpression[$ScriptCommandLine[[2]]]

Try it online!Try it online!

Wolfram Language (Mathematica), 263 bytes, score ~150000 on TIO

With[{size = 2 Ceiling[Sqrt@#/2.7] + 3}, 
   Print @@ 
    FixedPoint[
     BitAnd[#, 3] + 
       With[{q = BitShiftRight[#, 2]}, 
        Sum[RotateLeft[q, d], {d, {1, -1, size, -size}}]] &, 
     CenterArray[#, size^2]]] &@ToExpression[$ScriptCommandLine[[2]]]

Try it online!

Wolfram Language (Mathematica), 284 bytes, score ~150000 on TIO

Fixed a bug thanks to @att.

With[{size = 2 Ceiling[Sqrt@#/2.7] + 3}, 
   WriteString[$Output, ##] & @@ 
    FixedPoint[
     BitAnd[#, 3] + 
       With[{q = BitShiftRight[#, 2]}, 
        Sum[RotateLeft[q, d], {d, {1, -1, size, -size}}]] &, 
     CenterArray[#, size^2]]] &@ToExpression[$ScriptCommandLine[[2]]]

Try it online!

Source Link
alephalpha
  • 50k
  • 7
  • 68
  • 182

Wolfram Language (Mathematica), 263 bytes, score ~150000 on TIO

With[{size = 2 Ceiling[Sqrt@#/2.7] + 3}, 
   Print @@ 
    FixedPoint[
     BitAnd[#, 3] + 
       With[{q = BitShiftRight[#, 2]}, 
        Sum[RotateLeft[q, d], {d, {1, -1, size, -size}}]] &, 
     CenterArray[#, size^2]]] &@ToExpression[$ScriptCommandLine[[2]]]

Try it online!