python_text_battle icon indicating copy to clipboard operation
python_text_battle copied to clipboard

Better Implementation of Choice Handlers

Open darksun27 opened this issue 6 years ago • 0 comments

I saw your udemy course and liked the way you taught!

I went through your code and realized that this code can be written in an scalable way! You can make a JSON file of all the actions and assign a index to them. Next thing is to make a file defining all the functions and storing the objects in a variable mapping JSON items to the variables in a dictionary. This way the program would be more scalable and adding new features won't be hassle (adding if-elif conditions and code duplicacy)

implementation

Calling the function becomes way more easier: implementation2

darksun27 avatar Dec 23 '19 10:12 darksun27