Skip to content

Commit

Permalink
Vinicius Garcia e Otavio Cardoso
Browse files Browse the repository at this point in the history
  • Loading branch information
dojorio committed Mar 11, 2020
1 parent 270b5ae commit de43c16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions 2020/20200311 - poker - python/dojo.log
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Qua Mar 11 19:45:47 BRT 2020 - Vinicius Garcia e Otavio Cardoso
Qua Mar 11 19:58:50 BRT 2020 - Otavio Cardoso e Vinicius Garcia
Qua Mar 11 20:04:14 BRT 2020 - Vinicius Garcia e Otavio Cardoso
Qua Mar 11 20:09:30 BRT 2020 - Otavio Cardoso e Vinicius Garcia
Qua Mar 11 20:15:22 BRT 2020 - Vinicius Garcia e Otavio Cardoso
18 changes: 7 additions & 11 deletions 2020/20200311 - poker - python/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@ def hand_value(hand):

def sort_hand(hand):
splited = []
values = {
'T': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14
}

for card in hand:
splited.append(list(card))

for card in splited:
value = card[0]
if value == 'T':
card[0] = 10
elif value == 'J':
card[0] = 11
elif value == 'Q':
card[0] = 12
elif value == 'K':
card[0] = 13
elif value == 'A':
card[0] = 14

if value in values:
card[0] = values[value]
else:
card[0] = int(value)
card[0] = int(value)

splited.sort()

Expand Down

0 comments on commit de43c16

Please sign in to comment.