Education Google Apps Script Google sheets

Play Hangman Game in Google Spreadsheet

It’s been fun working with Google Spreadsheet. We have already published a lot of scripts, tools using Google Sheets and now let’s go beyond it. How about playing games, isn’t it crazy. Of course we can’t expect ‘NFS’ or ‘Clash of Clans’ in a browser and moreover a sheet is not meant for that. But it’s never bad to have some Proof of Concept and here we developed Hangman Game with Google Spreadsheet.

You can also check another cool sheet we published recently for educational purpose. That was for kindergartens kids and was liked by several people.

Hangman Game

Those who are not aware of, Hangman was initially a guessing game in pencil paper. Its a 2 or more person game where one will set phrases, words, sentences and others have to guess that word. For every wrong guess the other player draws one component of the hanged man. A correct guess will disclose all the appearance of the letters in the word. The game continues till all the components of the hanged man are drawn or the person correctly guesses all the letters of the word. In the later case the person wins.

How it works ?

There is a sheet called ‘Words’. One can set multiple words. When the game starts the script picks a random word from the list and creates blank placeholders for that word. There is a box to type your guess. Once you write something on the sheet, the ‘on edit’ trigger comes into play. It. The rest is all coding logic so I won’t go much deeper. Those who are interested can view the entire code at tools → script editor.

You can always hide the sheet after you set the words or even make it password protected (You never know when cheaters will peep into it 😛 LOL).

When running first time, it will ask you for permission, grant it and enjoy the game.

An use case can be, teachers can set words for kindergarten students. its really fun, interactive and brain storming.

Leave a Reply

Your email address will not be published. Required fields are marked *