Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major refactors #33

Merged
merged 20 commits into from
Jan 10, 2021
Merged

Major refactors #33

merged 20 commits into from
Jan 10, 2021

Conversation

A-Phamfam
Copy link
Collaborator

Major refactor of Guessing game

  • removed all integer representation of difficulty from the code
  • added sets of idols to choose from rather than looping until correct random idol is found
  • added async_timeout around idol_post() in case api is not responding for that idol for Error 500
  • abstract the game loop so that create_new_question() does not have to return a looping condition
  • moved Game.start_game() to init()
  • Added error catching

Major refactor to groupmember cards

  • Abstracted the card fields to a dictionary in cache rather than requiring if/else statements, this should make adding new fields and moving the order/ format of fields easier

Other refactors

  • Replaced papago translation keywords if/else statements with a dictionary in cache
  • Simplified get_cooldown_time() with divmod() function
  • Replaced for loops with list comprehensions and generator expressions where possible since they are faster than for loops

@MujyKun
Copy link
Owner

MujyKun commented Jan 10, 2021

looks good 👍

@MujyKun MujyKun merged commit 21ff1a8 into dev Jan 10, 2021
@MujyKun MujyKun deleted the refactor_dict branch January 10, 2021 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants