Simple Word Game

How to play

Enter a word you would like your mate to guess and then hit the New Game button. Simple as that. Have fun.



How to use this code

This simple website was created to demonstrate some code for the EU Code Week, and let me practise ECMASript 6 as well. Source available @github.

Using this code is fairly simple. You can go ahead and clone the git repository or download its content.

Take a close look at the code and you will very likely understand what's going on. Side note: you can define your own alphabet in the consctuctor of your class.

							
	document.getElementById('new-game').addEventListener('click', function() {
		const word = document.getElementById('word').value;
		const game = new wordGame(word, 10, ['a', 'b', 'c'...]);
		game.uiDiv = 'game';
		game.partialDiv = 'partial';
		game.attemptsDiv = 'attempts';
		game.initUI();
	});
							
						

Got any questions?

Feel free to contact me via email.