Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
カードをランダムにシャッフルするサンプル
string GetSuitMark(int suit){
// マーク(スート)のIDに応じた文字を返す
string suitMark;
switch (suit){
case Spade:
suitMark = "♠︎";
break;
case Club:
suitMark = "♣︎";
break;
case Heart:
suitMark = "❤︎";
break;
case Diamond:
suitMark = "♦︎";
break;
default:
suitMark = "JOKER";
break;
}
return suitMark;
}
string GetSpecialNumber(int number){
if (number < 11){
return number.ToString();
}
string special = "None";
switch (number){
case 11:
special = "J";
break;
case 12:
special = "Q";
break;
case 13:
special = "K";
break;
}
return special;
}
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.