ebosetalee / 20-days-challenge

#20dayschallenge on python
6 stars 0 forks source link

11 - Hangman-11 #27

Closed yudori closed 4 years ago

yudori commented 4 years ago

You'll be refactoring your code to use classes and objects.

Convert your hangman function into a class that takes in the target word in the constructor. The convert_to_dictionary and display_current_guess functions become methods in the class while the get_target_word function remains outside the class.

NB: Methods are just functions that are part of a class.

Basically, your final code should have:

target_word = get_target_word() hangman = Hangman(target_word) hangman.run()



**The actual functionality of the game doesn't change.**