Update hand.py
parent
66310aa2f5
commit
ea1a938aad
|
|
@ -83,3 +83,6 @@ class Hand:
|
|||
""" 返回手牌的字符串表示 """
|
||||
tiles_str = ", ".join(str(tile) for tile in self.tiles)
|
||||
return f"手牌: [{tiles_str}], 牌的数量: {dict(self.tile_count)}"
|
||||
def __iter__(self):
|
||||
"""使 Hand 对象可迭代,直接迭代其 tiles 列表"""
|
||||
return iter(self.tiles)
|
||||
Loading…
Reference in New Issue