Play the Hangman game example
mainThe Hangman example demonstrates how to use Leo to build a game that involves committing information to the chain and using that information to update game state.
Because Leo currently cannot create or consume records automatically, the game must be played manually using a loop of running the program, copying output, and updating an input file.
Gameplay Loop:
- Run
leo runto generate guesses for the dummy word. - Copy the required information printed to the terminal.
- Paste that information into the
hangman.infile. - Update the letter to be guessed in
hangman.in. - Run
leo cleanto clear the previous state. - Run
leo runagain to process the next turn. - Repeat until the game is over.
leo run
# Copy output to hangman.in
leo clean
leo run