Skip to content

Instantly share code, notes, and snippets.

@Arakaki-Yuji
Created July 25, 2016 05:01
Show Gist options
  • Save Arakaki-Yuji/2be1b4cc7c9c3d83b8cf1bce53a21abc to your computer and use it in GitHub Desktop.
Save Arakaki-Yuji/2be1b4cc7c9c3d83b8cf1bce53a21abc to your computer and use it in GitHub Desktop.
// 簡単なプログラミング問題でトランプソートというのを考えた。(というかもうありそう)
// トランプ1枚のデータ構造はtypeとnumberをキーに持つobject
SampleTrunmpCard = { "type" => "heart", number => 1 };
// typeは"heart"、"diamond", "club", "spade"の4種類
// numberは1~13まである。
// トランプの数は合計52枚
// ランダムに並べられているトランプをheartの1~>13,diamondの1~>13,clubの1~>13,spadeの1~>13の順になるように並び替える。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment