A number of C,C++ programs have been written to assist in the cataloging, processing and analysis of square tilings.

    tc2bkp (tablecode to bouwkampcode; S. Anderson) - Squared rectangles and squared squares are represented in a concise notation called bouwkampcode. Bouwkampcode without the parentheses and commas is called tablecode. Tablecode is easier to work with in computer programs. It is possible to convert between the two formats. Converting bouwkampcode to tablecode is trivial as it involves replacing parentheses and commas with whitespace, however converting the other way is not trivial and involves constructing the tiling geometrically and then placing the parentheses correctly, which is what tc2bkp does. The other utility programs operate on either bouwkampcode or tablecode, but most produce output in tablecode, so if you require bouwkampcode as the final product you will need this program to convert the tablecode. To use, type tc2bkp followed by the bouwkampcode file.

    bk2ps (bouwkampcode to postscript; S. Anderson) - converts bouwkampcodes (or tablecodes) into postscript booklets. You have a choice of 1, 6, 12 or 20 tilings per page. While one can construct a tiling from bouwkampcode by hand, it is convenient to let the computer produce the graphics. To use, just type the program name, you will be prompted for the number of tilings per page, and an input file.
    
    bk2all (bouwkampcode to all; S. Anderson) - simple squared squares and squared rectangles can be oriented in 8 different ways, usually only one 'canonical' orientation is chosen (with the largest corner square at the top left, and the larger of the two squares adjacent to it on the top). If you want all 8 tablecodes of a particular dissection, use this program to generate them. This program will operate on compounds but does not produce compound isomers, only the whole tiling is reoriented, not any included smaller dissections (the 'trivial' isomers - not the compound isomers). To use, type the program name followed the bouwkampcode filename.
    
    bk2cs (bk2cs - bouwkampcode to compound/simple; S. Anderson) - In the study of squared squares and squared rectangles, there are 3 important categories for dissections into squares;
        A dissection into squares is either a square dissection or a rectangle dissection, (there are other kinds but they dont concern us here)
        A dissection is either perfect (every square is a different size) or imperfect (some squares are the same size), and;
        A dissection is either simple or compound. A simple dissection does not contain a smaller squared rectangle or squared square, while a compound dissection does. Determining if a dissection is square/rectangular or perfect/imperfect is easy to program and can be done as the dissections are generated. Determining if a dissection is simple or compound is not a trivial operation, although it is easy to spot the difference by eye, it not so easy to program a computer to do so, and to do it efficiently requires some ingenuity. In the theory of squared rectangles 3-connected planar graphs with a identified edge (c-nets) produce simple tilings, and 2-connected graphs produce compound tilings. This is generally true, but there are exceptions, it is possible for c-nets to produce compounds in rare circumstances. In the higher orders what is rare at lower orders becomes more frequent and a means of separating simples from compounds is necessary, particularly if one is interested in enumerating the exact number of tilings of each kind for a given order of tilings.
        
    bk2cs is a program that inputs bouwkampcodes or tablecodes and separates them into 2 files, simple and compound. To use, type the program name, bk2cs followed by a bouwkampcode filename. 
    
    bk2cpss (bouwkampcode to CPSS; S Anderson) - If one substitutes a squared square into the elements of that or another squared square, and scales both so that all squares are integers, then a new squared square is the result. If this is applied to a bouwkampcode (or tablecode) listing, and if any resulting imperfects are filtered out then a new collection of CPSSs is the result. Starting with a single PSS, an unlimited supply of CPSSs can be created by performing this operation iteratively. As the smallest PSS (21 : 112 AJD) has 21 squares, performing this operation creates a CPSS of order 41 (one square is lost to become the container for the included square, so these varieties of CPSS start at order 41. SISSs with a single imperfection can also be used to create CPSSs, these SISSs start at order 22. To use, type the program name, bk2cpss followed by a bouwkampcode filename.
    
    bk2ism (bk2ism - bouwkampcode to isomers; S. Anderson) - if a dissection of a certain size squared square or rectangle can be done in more than one way (not counting the 8 trivial 'isomers' produced by bk2all) using the same set of squares, then the different dissections are called isomers. This program takes sorted bouwkampcode/tablecode and finds any isomers. As with bk2all the program will operate on compounds but does not produce compound isomers. Isomers had an important role to play in the history of squaring the square, they also make good puzzles. To use, type the program name, bk2ism followed by a bouwkampcode filename. bk2ism has been designed to work for perfects only.
    
    bk2mb (bouwkampcode to maximum square not on the boundary; S. Anderson) - If one looks at squared squares and squared rectangles it appears that the largest square is always in a corner. In fact there are rare exceptions, it is possible for the largest square not to touch the boundary of the tiling at all. This program searches bouwkampcode/tablecode and finds those particular dissections.
    
    bk2x (bouwkampcode to crossed square; S. Anderson) - A cross in a squared square or squared rectangle occurs where 4 squares meet at a point. In compound imperfect tilings (such as a bathroom floor with tiles all the same size) this is the norm and is completely unremarkable, however in simple and compound perfect tilings it is a very rare event. This program searches bouwkampcode/tablecode and finds squared rectangles and squared squares with crosses. To use, type the program name, bk2x followed by a bouwkampcode filename.
    
    bk2sss (bouwkampcode to squared squares squared; S. Anderson/Stijn Van Dongen) - If one takes a squared square, shrinks it and places copies inside each square of the squared square, then one can create a 'fractal' squared square. This program inputs bouwkampcode/tablecode and uses postscript code by Stijn Van Dongen to create 'fractal' squared squares in postscript. The postscript can be hand edited to change various parameters, such as reverse colouring and recursion level. Type the program name followed by the bouwkampcode filename.
    
    bk2canon (bouwkampcode to canonical tablecode; S. Anderson ) Converts bouwkampcode to canonical bouwkampcode (in tablecode form). A squared square or squared rectangle can be rotated and reflected in 8 ways. Each of the 8 ways has a different bouwkampcode. One of those 8 codes is the canonical code of that tiling. For perfect squarings it is the code with the largest corner element in the top left square, and the larger of the 2 elements adjacent to it on it's right. For imperfect squarings the same rule applies but further elements of the 8 codes may need to be compared, element by element, the canonical code is the largest code lexicographically speaking, based on numerical comparison of corresponding elements in the canonical code.

Stuart's programs are written in standard C++ and dont require any special libraries. In Windows, Stuart's programs have been compiled with the MinGW C++ compiler, available from http://www.mingw.org/wiki/Getting_Started the following example creates a standalone windows binary;
g++ -Wall -O4 -static bk2all.cpp -o bk2all

All Stuart Anderson's programs are in the zip files; bkutil.zip and bkutilwin.zip. bkutilwin.zip has source code for Windows, along with compiled executables, and bkutil.zip has source code for Linux/Mac. The same source code is now used in both. Source code for Microsoft Visual C++ is no longer supplied, as this compiler required different timing code and executables compiled on WinXP would not run on Windows 7, whereas MinGW compiled executables run on both. Armin Singer's programs are in the squaredance package.

If you are using Windows, the UnxUtils (http://giannistsakiris.com/wordpress/wp-content/uploads/2007/07/gnu-utils-win32.zip) is a very good package of general unix/linux commandline utilities, converted to run as windows executables. Great for sorting and sifting data ,like large collections of bouwkampcode files.


Armin Singer's programs are in the squaredance package, see www.squaring.net/downloads.html for details of Armin's programs.

If you find any bugs, please let me know
I can be emailed at stuart.errol.anderson@gmail.com

Stuart Anderson
27th April 2013
