Skip to content

Instantly share code, notes, and snippets.

@SpaceVoyager
Created October 1, 2016 19:36
Show Gist options
  • Save SpaceVoyager/8db88d7312fde4ea2a56ff1c16f3c598 to your computer and use it in GitHub Desktop.
Save SpaceVoyager/8db88d7312fde4ea2a56ff1c16f3c598 to your computer and use it in GitHub Desktop.
hangman.py
import canvas, console
def newgame():
word = console.input_alert('Please enter a phrase you have in mind:')
return word
canvas.clear()
word = newgame()
font = 'Arial Rounded MT Bold'
canvas.draw_text(word, 50, 100, font_name=font, font_size=100)
word_len = len(word)
underscores = ''
for i in range(word_len):
underscores += '_ '
canvas.draw_text(underscores, 0, 200, font_name=font, font_size=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment