Skip to content

Instantly share code, notes, and snippets.

@myokoym
Created July 25, 2011 13:08
Show Gist options
  • Save myokoym/1104078 to your computer and use it in GitHub Desktop.
Save myokoym/1104078 to your computer and use it in GitHub Desktop.
0〜9までの数値を重複しないように4つ並べた配列を取得する
# [0-9]{4} (unique)
Array.new(10) {|i| i }.shuffle.slice(0, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment