JavaScript Challenge #5 (Cows never forget)

Written By Christopher Pitt, on Wednesday, August 22nd 2012, 5:52am

The other day I was playing Fez when I was reminded of an old memory game I used to play where a sequence of colours are shown and the player has to repeat the sequence correctly to proceed. Players are shown increasingly long sequences or colours, stretching their memory to its limits!

This week’s challenge will be to create a memory game using shapes, colours, numbers or anything really, so long as it involves memory. Refer to the following diagram…

The basic idea is that your game should present a series of colours, shapes, numbers, etc. for the user to then repeat. If they get the sequence right, the next level starts, which increases in difficulty.

Hint: you should store the order of the sequence so that it can be reused when checking the user’s input. Make things interesting by allowing keyboard navigation, or varying the elements used from level to level.

You can make your solutions as intricate or as basic as you wish!

As before; post your solutions in the form of links to jsfiddle, tinker or jsbin (in the comment section) and we’ll update this post with the solutions that we think tackle the problem in ways worthy of mention.

Happy coding!

EDIT [2012/08/29]: We are closing comments and reviewing submissions. We will follow this post up with a review of our favourites and what they teach us about the task and JavaScript development in general.

One Response to “JavaScript Challenge #5 (Cows never forget)”

  1. Pete says:

    Presenting: Arrowed.

    http://jsfiddle.net/plamoni/aMFwr/embedded/result/

    Again, I used jQuery because I’m a rebel.

    Seems to work best in Safari, but appears to work fine in other modern browsers. There are a few minor glitches in timing, but aside from that it’s very playable. What I mean to say is that it’s reached the point all casually written computer games reach: Where it’s complete enough that you spend more time playing than coding and lose interest in the latter in favor of the former.

    This challenge was pretty free-form. I’m looking forward to what others create!