Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
カードをランダムにシャッフルするサンプル
void InitializeCardList(){
// 山札を初期化する
cardList = new List<Card>();
// 各マーク(スート)ごとにカードを生成
foreach (int suit in suits){
for (int i = 1; i <= numbersInSuit; i++){
Card card = new Card(suit, i, false);
cardList.Add(card);
}
}
// ジョーカーを追加
Card joker = new Card(0, 0, true);
cardList.Add(joker);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.