Tarsierdle

People who know me know that I do lots of word puzzles and games like the NYT crossword. It’s a natural progression to realise that you can draw things with Wordle and an even more natural progression (because it’s me) to combine it with a tarsier idea.

There are two win conditions in tarsierdle:

  1. Solve the three puzzles and get the word, like in normal wordle

  2. Draw a tarsier – namely, eyes and smile (aren’t their smiles so cute?)

Tarsierdle consists of two 5 letter words and one 7 letter word. You can play it at this link - currently I’ve been optimising this for laptop.

The colours corresponding to each guess are stored as three matrices for the implementation of the eye solver and the smile solver. The solver will also check that the matrices are of the right dimension, with each guess pushing another row into the matrices.

Eye solver

The eye solver looks at the colour of the letter in position [2,2]. We have two types of eyes: a rectangular eye and a diamond eye.

For the rectangular eye:

  1. All locations immediately surrounding the central position [2,2] are searched. They should all have the same colour.

  2. All locations surrounding this (it’s a 5x5 grid so there are only two iterations) should have the same colour.

For the diamond eye:

  1. All locations within a Manhattan distance of 1 that have not yet been searched are searched. They should have the same colour. If they do not, diamond_eye_valid will be marked false.

  2. The nodes are marked as being searched and the process is repeated until the boundaries are reached.

In general, we only need one of diamond_eye_valid or rectangular_eye_valid to be true, but it needs to be consistent across both eyes.

There are some edge cases. Test it and find out 😊

Smile solver

Any tarsier always has a smile (go look at Google images). There are two types of smiles and they’re best represented by the emojis :] and :). So one of them is curving upwards, while the other is horizontal. The smile solver takes the following steps:

  1. Check the row corresponding to the final guess. How many colours are there?

  1. If there is one colour, go to step 2

  2. If there is more than one colour, go to step 3

  1. If there is more than one colour, we can either create the :] or the :) smile. However, we need to first make sure that the remainder of the row is contiguous. Also, because tarsiers are perfectly symmetrical, we can’t have a slanted smile.

  1. We start from position 3 and check its colour. We set a start_index and end_index of 3 and smile = 1.

  2. We now check position 2 and 4. Is the colour same as that of position 3? If so, we keep smile = 1 and set start_index = 2, end_index = 4. We can’t have asymmetrical smiles so both position 2 and 4 need to be the same colour.

  3. Let’s go on now to position 1 and 5. Is the colour the same as that of position 2 and 4? Let’s assume not. We now change smile to 0 and record the colour, which will be our background colour.

  4. Is position 0 and 6 the same colour as 1 and 5? It has to be, otherwise we can’t win with the second tarsierdle condition.

  5. Now we need to check the row above to know what sort of smile we are creating. We take the start and end index and compare it, with an edge case: if start_index = end_index = 3, we need to make the :) smile as :- is not a smile.

  1. If there is one colour, we automatically have to create the :] smile. This means that we need to check the row above – that:

  1. The number of unique colours is 2

  2. Position 0 and position 6 have the same colour as the row below (colour 0), with position 1-5 of the other colour (colour 1).

  3. There are some edge cases. Is :| allowed? Test it and find out!

An interesting point is that the tarsierdle solver should be indifferent towards what the colour that distinguishes features is. So I could make a smile out of yellow blocks, green blocks, or grey blocks.

Putting it together

The next step was to make sure that the data was stored properly. It was simply arrays, with each row of the array corresponding to the colours associated with a guess. Nothing too big.

Some React hooks were used to store different states, such as which solves were possible, what guesses were made, etc.

Full disclosure, I used chatGPT to help me with the HTML and a bit of CSS because the effort-reward ratio for that wasn’t really there in my eyes. I wanted to have the fun of figuring out the respective solvers. That being said I often needed to redo the CSS to make it work as I wanted, so that part of the project wasn’t purely chatGPT.

It was important for me to put my imprint on Tarsierdle. It was important to put a motivational/meaningless quote at the bottom of the tarsierdle game and I think that’s something that people who know me know I do quite a bit.

Timescales

I did this project over three afternoons. The first two afternoons were spent on the eye solver and smile solver, and I put it all together in another afternoon after that.

I hope you enjoy playing Tarsierdle. I really enjoyed making it and I hope it gives you a tarsier smile.