Created
January 26, 2018 11:26
-
-
Save clamytoe/eca88719a5f02b3dba91c2a7acba46dc to your computer and use it in GitHub Desktop.
hangman.py
This file contains hidden or 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
| from os import system, name | |
| from time import sleep | |
| from console import clear | |
| # art from https://codereview.stackexchange.com/questions/101968/hangman-with-ascii | |
| ascii_art = (""" | |
| _________ | |
| |/ | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |___ | |
| """, """ | |
| _________ | |
| |/ | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |___ | |
| H""", """ | |
| _________ | |
| |/ | | |
| | (_) | |
| | | |
| | | |
| | | |
| | | |
| |___ | |
| HA""", """ | |
| ________ | |
| |/ | | |
| | (_) | |
| | | | |
| | | | |
| | | |
| | | |
| |___ | |
| HAN""", """ | |
| _________ | |
| |/ | | |
| | (_) | |
| | /| | |
| | | | |
| | | |
| | | |
| |___ | |
| HANG""", """ | |
| _________ | |
| |/ | | |
| | (_) | |
| | /|\ | |
| | | | |
| | | |
| | | |
| |___ | |
| HANGM""", """ | |
| ________ | |
| |/ | | |
| | (_) | |
| | /|\ | |
| | | | |
| | / | |
| | | |
| |___ | |
| HANGMA""", """ | |
| ________ | |
| |/ | | |
| | (_) | |
| | /|\ | |
| | | | |
| | / \ | |
| | | |
| |___ | |
| HANGMAN""") | |
| def clear_screen(): | |
| if name == 'nt': | |
| _ = system('cls') | |
| elif name == 'posix': | |
| clear() | |
| else: | |
| _ = system('clear') | |
| def main(): | |
| for art in ascii_art: | |
| clear_screen() | |
| print(art) | |
| sleep(1) | |
| if __name__ == '__main__': | |
| main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment