Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.

Magic Carpet Visualiser

Visualising magic lines within a magic carpet using SVGs.

A magic carpet is a grid of one magic square, for instance in this example an order 4, tiled 9 times to a 9x9 grid, where any selection of 4x4 numbers is also a magic square. Where identical "magic line' patterns occur, this shows how the sequence of numbers remains identical except the numbers are "shifted along" the magic line in the grid.

Part of larger body of work on magic squares.


  • add ability to change carpet


16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1


1 8 13 12 14 11 2 7 4 5 16 9 15 10 3 6