Hangman is a paper and pencil guessing game for two or more players. One player thinks of a word, phrase or sentence and the other(s) tries to guess it by suggesting letters or numbers, within a certain number of guesses.
The aim of the game is guessing letters in a partially or fully obscured word. The network receives as input a representation of the word (total number of characters, the identity of any revealed letters) as well as a list of which letters have been guessed so far. It returns a guess for the letter that should be picked next.
Project is created with:
- HTML5
- CSS3
- JS ES6
Project is: done
function start() {
var divContent = ""; //place of alphabet
//loop that will work 35 times
for (i=0; i<=34; i++) {
var element = "lett" + i; //creating IDs for particular letters (lett1, lett2, etc)
divContent = divContent + '<div class="letter" onclick="sprawdz('+i+')" id="'+element+'">'+letters[i]+'</div>'; // div with letters creation
if ((i+1) % 7==0) divContent = divContent + '<div style="clear:both;"></div>'; // clear:both every 7 letter to start a new row of letters
}
document.getElementById("game-alphabet").innerHTML = divContent;
show_sentence();
}
- Phrases are uploaded into the game
- If the correct letter is selected it appears in the screen
- If the wrong letter is selected the image changes
- at the end you can select to play one more time by submitting the button
everything has been done
Contributions to the project library are welcome. Please note the following guidelines before submitting your pull request:
- Follow JS coding standards
- Write tests for new functions and added featues
MIT License: Copyright (c) 2018 Martyna Zyskowska
Martyna Zyskowska