Ionică Bizău

The Amazing Tangram Square

I was 7 years old when I first found out what the Tangram Square is. I saw it in a Maths book and I quickly started to have fun with it.💫

The Tangram is a Chinese geometrical puzzle consisting of a square cut into seven pieces:

  • 2 large right triangles
  • 1 medium right triangle
  • 2 small right triangles
  • 1 square
  • 1 parallelogram

These pieces can be used to create different shapes (animals, objects etc).

Recently I thought that it's not a bad idea to to bring this game on the WEB, so anybody can play it.

And I did it! You can play it here. ✨

Using svg.js and a bit of math I created the pieces. To make them interactive, I set up the mouse-related events (click, drag etc):

  • Left click: rotate left
  • Right click: rotate right
  • CTRL + left click: flip
  • Hold left click + move: drag

You can build pretty much anything. From hearts… 💖

…to cats 😻…

…and a lot of other shapes. Then, once you got it, be creative and create your own stuff.

The source code is hosted on GitHub. Hope you'll enjoy playing this game! 😁

Have feedback on this article? Let @IonicaBizau know on Twitter.

Have any questions? Feel free to ping me on Twitter.