Skip to content

Commit

Permalink
Merge 2993ecf into 2c3506f
Browse files Browse the repository at this point in the history
  • Loading branch information
billmuch committed Nov 28, 2019
2 parents 2c3506f + 2993ecf commit 24349ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rlcard/games/doudizhu/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import functools
import copy
from heapq import merge

from rlcard.games.doudizhu.judger import cards2str
from rlcard.games.doudizhu.player import DoudizhuPlayer as Player
Expand Down Expand Up @@ -193,8 +194,7 @@ def _get_others_current_hand(self, player):
player_up = self.players[get_upstream_player_id(player, self.players)]
player_down = self.players[get_downstream_player_id(
player, self.players)]
others_hand = (player_up.current_hand + player_down.current_hand)
others_hand.sort(key=functools.cmp_to_key(doudizhu_sort_card))
others_hand = merge(player_up.current_hand, player_down.current_hand, key=functools.cmp_to_key(doudizhu_sort_card))
return cards2str(others_hand)

#if __name__ == '__main__':
Expand Down

0 comments on commit 24349ab

Please sign in to comment.