Arrange the numbers 1 to n² in a magic square, then think of each number as a column of stone that tall. Rain pools in the low cells. Hold as much water as you can, for every n from 4 to 28.
(16,3,2,13), (5,10,11,8), (9,6,7,12), (4,15,14,1).Where this came from. Craig Knecht brought the problem to Al Zimmermann, who ran it as a contest from March to June 2010. Walter Trump won and Hermann Jurksch came second, and as at many of Al's contests, first prize was a Bathsheba Grossman sculpture. The records come from Al's final report, which kept every best square, so every record here has been re-scored by our scorer. Want a computer to search for you? The simulator in the Lab anneals squares in your browser, saves its best ones here, and can start from any square on this page.
As on the original site, here is the code that scores every entry, so you can check your own before you send it. It's written to be easy to read, not fast. Each version reads one entry per line and prints its score. We've checked all four against the site on all 102 squares in Al's final report, plus 210 altered ones, good and bad.
Why QBasic? It's the first programming language Neil, who runs ISS, ever learned, and this version is a nod to that. QBasic can't read typed-in input the way the others do, so it reads your entries from SQUARES.TXT and saves its answers in RESULTS.TXT.
Loading…