Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created June 26, 2018 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/7f0ccda414e4e9a2f820705edea103a5 to your computer and use it in GitHub Desktop.
Save todorok1/7f0ccda414e4e9a2f820705edea103a5 to your computer and use it in GitHub Desktop.
カードをランダムにシャッフルするサンプル
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