Downloads

Freeware Disclaimer

The software on this site may be used freely.
You should use only if you agree to the freeware disclaimer.

The programs here are Microsoft® Visual C++® Console Applications.

To make a copy of a console:
  Click the upper left corner button, and Edit, Select All.
  Click the upper left corner button, and Edit, Copy.
  Paste to a text file.

To paste input, such as, a file name, into a console:
  Copy the file name from somewhere.
  Click the upper left corner button, and Edit, Paste.

There are source code files and CLR and Win32 applications for the programs described below.

Note: Run times are for a 2.2 GHz PC.

Adjacent

AdjacentCornerSquares Win32 exe CLR exe C code
Makes adjacent corner pair magic squares. Output files are in folder AdjacentCornerSquares[_n].

AdjacentSideSquares Win32 exe CLR exe C code
Makes adjacent side pair magic squares. Output files are in folder AdjacentSideSquares[_n].

Associative

AssociativeSquares Win32 exe CLR exe C code
Makes associative magic squares. For singly-even order the squares are near-associative. Output files are in folder AssociativeSquares[_n].

Bordered

BorderedSquare Win32 exe CLR exe C code
Makes bordered magic squares. Makes one distinct square of each order using an algorithm developed for the HP-41C pocket calculator. Output files are in folder BorderedSquare[_n].

BorderedSquares Win32 exe CLR exe C code
Makes bordered magic squares. Makes many distinct squares by randomly:

Output files are in folder BorderedSquares[_n].

BorderedSquares1 Win32 exe CLR exe C code
An earlier version that made many fewer distinct squares, only randomly rotating each nested border and the center. Output files are in folder BorderedSquares[_n].

Bordering

BorderingSquares Win32 exe CLR exe C code
Makes bordering magic squares. Output files are in folder BorderingSquares[_n].

Composite

CompositeSquares Win32 exe CLR exe C code
Makes composite magic squares of order MN from input squares of order M and order N. Output files are in folder <M>-<N>-CompositeSquares[_n].

Franklin

FranklinMagicSquares Win32 exe CLR exe C code
Makes Franklin magic squares. Output files are in folder FranklinNormalMagicSquares[_n].

Most-perfect

Most-perfectSquares Win32 exe CLR exe C code
Makes most-perfect magic squares. Output files are in folder Most-perfectSquares[_n].

Pandiagonal

PandiagonalSquares Win32 exe CLR exe C code
Makes pandiagonal magic squares. Output files are in folder PandiagonalSquares[_n].

Self-complement

SelfComplementSquares Win32 exe CLR exe C code
Makes side-to-side symmetric self-complement even order magic squares. Output files are in folder SelfComplementSquares[_n].
To make associative self-complement magic squares, use program AssociativeSquares

Symlateral

SymlateralSquares Win32 exe CLR exe C code
Makes symlateral magic squares. Output files are in folder SymlateralSquares[_n].

Order 4

Order4 Win32 exe CLR exe C code
Makes the 880 order 4 magic squares. Output is a .txt file.

Order 5

Order5 Win32 exe CLR exe C code
Makes the 275,305,224 order 5 magic squares.

Files are output in folder Order5[_n]. There are 25 .txt files, one each for the squares with the same center value. The files contain only the squares in a single column. Numbers are separated by white space characters, (blank, newline).

WARNING: The files are large, ranging from 341 MB to 1,492 MB, (total 21 GB).

Order5Special Win32 exe CLR exe C code
Makes special order 5 magic squares. The types made are associative, concentric, bordered, inlaid corner, inlaid side, pandiagonal, ultramagic. Files are output in folder Order5Special[_n].

Order5Count   Win32: 7 minutes CLR: 11 minutes C code
Computes the number of order 5 magic squares. Only the source code is provided.

Order 6 Concentric

Order6C Win32 exe CLR exe C code
Makes 4x4 center squares and border groups. For an input range of partitions, the output is:

See Order6CDoc.txt and Order6CExamples.txt. Output files are in folder Order6C[_n].

Order6CSample Win32 exe CLR exe C code
Makes a sample of the squares. One square is output for each of the center/border partitions, (22,145 squares). Output is a .txt file.

Order6Ccount   Win32: 5 minutes CLR: 7 minutes C code
Computes the number of order 6 concentric magic squares, (736,347,893,760). Only the source code is provided.

Order 7 Concentric

Order7Ccount   Win32: 4 h 40 m CLR: 5 h 23 m C code
Computes the number of order 7 concentric magic squares, (3,835,791,613,181,952,000). See Order7CDoc.txt. Only the source code is provided.

Utility Programs

Input for these programs is a .txt file containing one or more number squares of the same order. The text file must contain only the square numbers separated by white space characters, (blank, horizontal tab, newline).

You will be prompted first to input the order of the squares, and, then the file name. The file name can be the absolute path name or the path name relative to the folder containing the program. It is not necessary to enter the .txt extension. For example, if program Frenicle is in folder C:\Squares and the file is C:\Squares\order4squares.txt, the file name can be entered as any of:

Bones Win32 exe CLR exe C code
Changes squares to or from bones format. Square numbers must be in the range 1 to N² or 0 to N²-1 for sensible results. Output .html file(s) are in folder ToFromBones<N>[_n]. If the input file is large, output may be split into a number of files.

CopySquaresByNumber Win32 exe CLR exe C code
Copies squares from a file. Squares to copy are chosen by a number or number range. The output file is Order<N>Copy<num>[_n].txt or Order<N>Copy<num1>to<num2>[_n].txt

CopySquaresByType Win32 exe CLR exe C code
Copies squares from a file. Squares to copy are chosen by include and exclude type lists. The output file is Order<N>Copy[_n].txt

Frenicle Win32 exe CLR exe C code
Puts squares in Frénicle standard form and sorts them in ascending order. The number of duplicate squares is reported and duplicates are not output. The output file is <in file name>Frenicle[_n].txt

GetMagic Win32 exe CLR exe C code
Checks if squares are magic. The program classifies each square as normal magic, other magic, or not magic. If the squares are not all of the same class, they are written to separate files: NormalMagic, OtherMagic, NotMagic. The files are written to folder Order<N>Squares[_n].

GetType Win32 exe CLR exe C code
Checks the type of each square as: not magic, normal semi-magic, other semi-magic, normal magic, other magic. If the type is normal magic, checks other properties: adjacent corner, adjacent side, associative, concentric, bordered, bordering, symlateral, pandiagonal, compact, complete, bent diagonal, Franklin, zigzag, self-complement. See notes. Results are written to <in file name>TypeSummary[_n].txt.

Rotate Win32 exe CLR exe C code
Rotates squares to a different aspect chosen by the rotation number:

     Number                   Rotation
    --------    -----------------------------------------------------
        0                       none
        1                   clockwise 90°
        2                       180°
        3                counterclockwise 90°

        4       180° about middle vertical or Y axis,   (= mirror)
        5       180° about main forward diagonal,       (= mirror + 1)  
        6       180° about middle horizontal or X axis, (= mirror + 2)  
        7       180° about main back diagonal,          (= mirror + 3)

        8                       all

Transform

Transforms1_2 Win32 exe CLR exe C code
Transforms squares using transform 1 and/or transform 2. For each squares file, you can do a transform and then opt to do another transform of that transform. If declined, you can opt to do another transform on the original squares. If declined, you can opt to transform another file of squares. The transform is selected by the number of rows entered, (1 or 2).

The flow chart is:


          --------------->--------- enter the order
         ^                                 |
         |                        enter the file name
         |                                 |
         |    ----------->--------- enter the rows(s)
         |   ^   ^                         |
         |   |   |                   transform squares
         |   |   |                         |
         |   |    <- YES <- transform transformed squares?
         ^   ^                             |
         |   |                             NO
         |   |                             |
         |    <----- YES <--- transform original squares?
         |                                 |
         |                                 NO
         |                                 |
          <--------- YES <----- transform another file?
                                           |
                                           NO
                                           |
                                          end

Transforms1_2All Win32 exe CLR exe C code
For each square in an input file, makes (a sample of) all possible squares from repeated transform 1 and/or transform 2. Output files are in folder Order<N>XForm[_n]. There is one file for each square in the input file. The first square in each output file is the original square.

Complement Win32 exe CLR exe C code
Makes the complementary squares. The output file is <in file name>Complement[_n].txt.
Self-complement squares are also written to <in file name>SelfComplement[_n].txt

AssocPan Win32 exe CLR exe C code
For doubly even orders, transforms associative magic squares to or from pandiagonal complete magic squares. Output file(s) are in folder Order<N>AssocPan[_n]. If the input file is large, output may be split into a number of files.

Most-perfectToFranklin Win32 exe CLR exe C code
For orders that are a multiple of 8, transforms most-perfect squares to Franklin magic squares. Output file(s) are in folder Order<N>Franklin[_n]. If the input file is large, output may be split into a number of files.

Water Retention

WaterRetention Win32 exe CLR exe C code
Computes and displays the water retention patterns of number squares. Water retention is an idea of Craig Knecht. The program is based on an algorithm of Gareth McCaughan.

See requirements for the input file under the Utility Programs heading. An example text file of the 880 order 4 magic squares is provided. Output .html files are in folder Water<N>[_n]. If the input file is large, output may be split into a number of files. Here is an output example:

WaterRetention3D Win32 exe CLR exe C code
Displays a 3-dimensional view of water retention. The code for the 3D view was written by Claudio Rocchini during the Zimmermann contest. Land is shown in shades of green, water in blue, and the start of spillways between water bodies or out of the square in yellow. For water, the bottom elevations are shown. Here are examples:

Output files are in folder Water<N>_3D[_n]. The files are in Scalable Vector Graphics (SVG) format. There is one .svg file for each square in the input file.

You may need to install a viewer like Win 98-XP from Adobe, before your browser will open .svg files. Another way is to download and run a program such as Windows - installer from Inkscape. With Inkscape you can open a .svg file and save it as a .png.

WaterRetentionSort Win32 exe CLR exe C code
Sorts squares in decreasing order of water retention. The number of duplicate squares is reported and duplicates are not output. The output file is <in file name>WRsort[_n].txt. A summary file is also written.

formatZtoW Win32 exe CLR exe C code
Re-formats squares in Zimmermann contest format to the white space separated format used by programs on this site. Squares are output in folder WfromZ[_n].