Unfinished JavaScript version of Tetravex


Years ago I started playing around with the (at the time) fairly new <canvas> element in JavaScript. I thought it would be fun to write a version of the old Tetravex game, since it's very simple in operation. Just dragging square tiles from one board to another and getting them to match up the numbers/colours.

Here's what my unfinished version looks like so far (this is a screenshot not the actual thing, see below for link):

    Screenshot of the game showing two boards side by side, each with 3 squares across and 3 down.
    The left board is empty and the right one has the nine tiles jumbled up.
    There are 3 buttons along the top: ‘Show Solution’, ‘Help’, and ‘Change Size’.

The goal is to move the tiles from the right hand board to the left but arrange them so that all the numbers and colours match. I borrowed the tile colours from Gnome Tetravex.

I'm releasing this under the GNU GPL, version 3 or later.

It's currently unfinished. There are some less than great things about the UI, and the ‘Help‘ button doesn't do anything. The ‘Show Solution’ button is a toggle, but doesn't indicate whether it's on or not.

Currently it requires keyboard commands, although they're not indicated, so here they are:

You can change the size to get a new larger board that's more challenging.

Here's a link where you can play the game: Tetravex

Here's the JavaScript code: tetravex.js

If I manage to get the thing finally finished I might write up some of the techniques. It's nothing fancy, but might be useful to someone.