SimpleHangman

The SimpleHangman Service provides RPCs for playing single player hangman. The service will choose a word for the player to guess using the given RPCs.

RPCS

SimpleHangman.getCurrentlyKnownWord()

Get the current word with where unknown letters are replaced with “_”.

Returns: String (String) - current word with blanks

SimpleHangman.getWrongCount()

Get the current number of incorrect guesses.

Returns: Integer (Integer) - number of wrong guesses

SimpleHangman.guess(letter: String)

Guess a letter in the current word.

Arguments:

SimpleHangman.isWordGuessed()

Check if the current word has been guessed correctly.

Returns: Boolean (Boolean) - true if word was guessed correctly

SimpleHangman.restart(word: String?)

Restart the current game.

Arguments:

  • word: String? (String) - New word to guess

Returns: Boolean (Boolean) - true on successful restart