Created
June 9, 2020 19:44
-
-
Save reymon359/3631ccc915222b359df9c201a0a110bf to your computer and use it in GitHub Desktop.
hangmanAminationConsole.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hangmanStages = [ | |
` | |
`, | |
` | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | |
| | |
| | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| | |
| | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| | | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| |- | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| -|- | |
| | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| -|- | |
| \\ | |
| | |
| | |
`, | |
` | |
|--------- | |
| | | |
| O | |
| -|- | |
| / \\ | |
| | |
| | |
`, | |
]; | |
var stage = 0; | |
var delayMs = 500; | |
var drawHangman = function(){ | |
console.clear(); | |
console.log(hangmanStages[stage]); | |
stage++; | |
if (stage < hangmanStages.length) { | |
setTimeout(drawHangman, delayMs); // again! | |
} | |
} | |
setTimeout(drawHangman, delayMs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment