欧美xxxx做受欧美1314,免费人成视频在线播放,卡一卡2卡3卡精品网站,欧美成人看片黄a免费看,久久香蕉国产线看观看猫咪av

CSSE1001/7030 課業(yè)解析

使用Python語言填寫leepCoders的模型類

最佳答案
  • 課程顧問-小管家
    課程顧問-小管家 2023-04-20 01:52:57
    立即咨詢

    解析:

    按照文檔的類關(guān)系和函數(shù),填寫代碼模板中的類

    Card:卡牌類

    play(self, player: Player, game: a2_support.CodersGame):#在玩家玩牌的時候調(diào)用,玩家丟棄手中的牌從牌堆中拾取新的牌。

    action(self, player: Player, game:a2_support.CodersGame, slot: int): #使用特殊牌的時候被調(diào)用

    str(self) -> str(Card()): #返回當(dāng)前牌的信息

    __repr__(self) -> str:#同上

    Deck:牌堆類

    get_cards(self) -> List[Card]: #返回牌堆中的卡組列表

    get_card(self, slot) -> Card: #返回指定的slot

    top(self) -> Card: #返回最后添加的卡片

    remove_card(self, slot): #刪除指定slot的卡片

    get_amount(self) -> int: #返回牌堆中牌的數(shù)量

    shuf?e(self): #洗牌

    pick(self, amount: int=1) -> List[Card]: #取第一張卡并返回

    add_card(self, card: Card): #在牌堆頂部添加一張卡

    add_cards(self, cards: List[Card]): #在牌堆頂添加一列卡牌

    copy(self, other_deck: Card): #從其他的牌堆中復(fù)制到當(dāng)前牌堆

    str(self) -> str: #返回牌堆中包含的卡牌的字符串表示

    repr(self) -> str: #同上

    Player:玩家類

    get_name(self) -> str: #返回玩家名稱

    get_hand(self) -> Deck: #返回玩家的手牌

    get_coders(self) -> Deck: #返回玩家手牌中的coderCard

    has_won(self) -> bool: #如果玩家手中有4個或以上的coderCard,返回trueMarking:計分類

    Total Mark = (functionality + style)/2 #累計分數(shù)公式

    涉及知識點:

    python面向?qū)ο?、字符串處?/p>

其他答案

17年深耕全階段留學(xué)輔導(dǎo)   數(shù)十萬留學(xué)生信賴

添加微信:「 kaoersi03 」備注官網(wǎng)申請試聽,享專屬套餐優(yōu)惠!

解決學(xué)業(yè)難題!1v1線上輔導(dǎo)——

復(fù)制成功

微信號: kaoersi03

備注“官網(wǎng)”享專屬套餐優(yōu)惠!