Skip to content

Commit

Permalink
Otavio Cardoso e Vinicius Garcia
Browse files Browse the repository at this point in the history
  • Loading branch information
dojorio committed Mar 11, 2020
1 parent 5f0706d commit c3c2dc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 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 @@ -5,3 +5,4 @@ Qua Mar 11 19:29:20 BRT 2020 - Otavio Cardoso e Vinicius Garcia
Qua Mar 11 19:35:07 BRT 2020 - Vinicius garcia e Otavio Cardoso
Qua Mar 11 19:40:25 BRT 2020 - Otavio Cardoso e Vinicius garcia
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
4 changes: 4 additions & 0 deletions 2020/20200311 - poker - python/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def sort_hand(hand):
value = card[0]
if value == 'T':
card[0] = 10
elif value == 'J':
card[0] = 11
else:
card[0] = int(value)

Expand All @@ -23,6 +25,8 @@ def sort_hand(hand):
value = card[0]
if value == 10:
card[0] = 'T'
elif value == 11:
card[0] = 'J'
else:
card[0] = str(value)

Expand Down
4 changes: 4 additions & 0 deletions 2020/20200311 - poker - python/test_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def test_higher_card_2(self):
hand = ['2D','3C', 'TH', '5S', '6D']
self.assertEqual(sort_hand(hand), ['TH', '6D', '5S', '3C', '2D'])

def test_higher_card_3(self):
hand = ['2D','3C', 'TH', 'JS', '6D']
self.assertEqual(sort_hand(hand), [ 'JS', 'TH', '6D','3C', '2D'])

if __name__ == "__main__":
unittest.main()

0 comments on commit c3c2dc7

Please sign in to comment.