Commits

Go Yamada committed 8f4f4ea

applies: grouping_cards

  • Participants
  • Parent commits ba8735d

Comments (0)

Files changed (1)

 
 
 def is_one_pair(cards):
-    card_dict = {}
-    for card in cards:
-        if card in card_dict:
-            card_dict[card] += 1
-        else:
-            card_dict[card] = 1
+    card_dict = grouping_cards(cards)
 
     # 手札のまとめを調べて、3カードが存在したらFalseを返す
     # 手札のまとめを調べて、pairの数を数える
 
 
 def is_two_pair(cards):
-    card_dict = {}
-    for card in cards:
-        if card in card_dict:
-            card_dict[card] += 1
-        else:
-            card_dict[card] = 1
+    card_dict = grouping_cards(cards)
 
     # 手札のまとめを調べて、3カードが存在したらFalseを返す ※不要
     # 手札のまとめを調べて、pairの数を数える