我创建了一组要洗牌的卡片对象。但是,当我使用简单的 shuffle 方法时,输出不正确。它不是洗牌,而是复制一些卡片并删除其他卡片。这是打印内容的示例Jack of Clubs5 of Hearts4 of Hearts7 of Hearts5 of HeartsAce of Spades8 of Clubs5 of HeartsJack of DiamondsJack of ClubsQueen of DiamondsJack of Diamonds9 of Diamonds4 of HeartsJack of Diamonds3 of Diamonds6 of DiamondsJack of Clubs4 of Hearts10 of DiamondsJack of Diamonds2 of DiamondsQueen of Diamonds7 of Hearts5 of HeartsKing of Diamonds5 of Hearts9 of DiamondsAce of Spades4 of DiamondsKing of Diamonds10 of Hearts9 of Diamonds2 of Diamonds10 of Diamonds5 of Hearts10 of DiamondsQueen of DiamondsQueen of DiamondsQueen of Diamonds4 of Diamonds2 of Diamonds9 of DiamondsQueen of Diamonds10 of Diamonds7 of Hearts5 of Hearts8 of Clubs4 of Hearts5 of Hearts5 of Hearts5 of Hearts如您所见,钻石太多,而几乎没有梅花或黑桃。我也注意到只有西装是乱七八糟的。每个数字都有四个,四个千斤顶皇后,国王和 A。谢谢您的帮助。
添加回答
举报
0/150
提交
取消