N Words Game


In the book The Complete Guide to Memory by Richard Restak, he describes a couple games where you get a series of random numbers, and try to recall the previous cards. So I created a version of this called the n-words-game. Although this is not a great name since it isn’t really words, but the number but characters. However, n-characters game just doens’t sound as good.

You can find the game here.

The game starts you off on selecting your settings. You can set the number of rounds you want to play and how far you are looking back. During the game, you are shown a series of random letters. Let’s say you are shown a series of random letters A and B on round 1 and 2. If lookback = 2, on round three you want to try and remember what character was shown 2 rounds ago. So in round 3, try to remember the character from round 1 which was A. The number of guesses you make is determined by the length of the game. After the game ends, you are shown how well you did.

This was also a learning project with svelte, a javascript framework like react. I found it a look more enjoyable compared to react. React felt like writing javascript with html stuffed in, and I never really liked it. Svelte on the other hand felt more like an extension of plain html, css, javascript. It felt like writing little snippets of html which are composed together. I can see the appeal of svelte, and I think it is what I will go to if I have a web project in the future.

Below is some pseudo-code from the main game component of the project. The full project is available on github.

<script>
    import GameMenu from 'components/GameMenu';
    import WordGame from 'components/WordGame';
    let options = {};
    function setOptions() {...};
    let state = 'menu';
</script>

{#if state == 'game'}
	<WordGame {options} />
{:else if state == 'menu'}
	<GameMenu {setOptions} />
{/if}