Created
June 26, 2018 05:09
-
-
Save todorok1/7f0ccda414e4e9a2f820705edea103a5 to your computer and use it in GitHub Desktop.
カードをランダムにシャッフルするサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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