Skip to content

Commit

Permalink
updated decider program to be more user-friendly (it's still pretty u…
Browse files Browse the repository at this point in the history
…nusable though)
  • Loading branch information
theelk801 committed Mar 9, 2019
1 parent 8371535 commit da74e64
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
46 changes: 28 additions & 18 deletions decider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,31 @@ def get_input(prompt):
print('Please enter a number')


powders_in_hand = get_input('How many Serum Powder are in your hand?')
other_in_hand = get_input('How many other cards are in your hand?')
powders_on_bottom = get_input(
'How many Serum Powder are on the bottom of your library?')
other_on_bottom = get_input(
'How many other cards are on the bottom of your library?')
powders_in_deck = get_input(
'How many Serum Powder are in your deck (but that you know are not on the bottom)?'
)
other_in_deck = get_input(
'How many other cards are in your deck (but that you know are not on the bottom)?'
)
mull_count = get_input(
'How many times have you taken a normal mulligan (i.e. how many cards will you need to put on the bottom)?'
)

action_to_take(powders_in_hand, other_in_hand, powders_in_deck, other_in_deck,
powders_on_bottom, other_on_bottom, mull_count)
powders_in_deck = 4
other_in_deck = 52
powders_on_bottom = 0
other_on_bottom = 0
mull_count = 0

while True:
print('\nIf you have a Bazaar, keep!\n')

powders_in_hand = get_input('How many Serum Powder are in your hand?')
other_in_hand = get_input('How many other cards are in your hand?')

best_action = action_to_take(powders_in_hand, other_in_hand, powders_in_deck, other_in_deck,
powders_on_bottom, other_on_bottom, mull_count)

print(advice_string(best_action, mull_count))

if best_action == 'regular':
mull_count += 1
powders_in_deck += powders_on_bottom
other_in_deck += other_on_bottom
powders_on_bottom = other_on_bottom = 0
else:
powders_to_bottom, other_to_bottom = best_action
powders_on_bottom += powders_to_bottom
other_on_bottom += other_to_bottom
powders_in_deck -= powders_in_hand
other_in_deck -= other_in_hand
2 changes: 1 addition & 1 deletion prob_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ def action_to_take(powders_in_hand,
mull_dict[(powders_to_bottom, other_to_bottom)] = powder_mull

best_action = max(mull_dict.keys(), key=mull_dict.get)
print(advice_string(best_action, mull_count))
return best_action

0 comments on commit da74e64

Please sign in to comment.