Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@youz
Last active June 4, 2021 07:33
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 youz/84237fe147f1a7d7100936afb9baa765 to your computer and use it in GitHub Desktop.
Save youz/84237fe147f1a7d7100936afb9baa765 to your computer and use it in GitHub Desktop.
usage: ruby dice.rb 8 5 | ruby judge.rb | sed -f nko.sed
ndice = $*[0].to_i
rounds = $*[1].to_i
rounds.times {
puts ndice.times.map{(rand(6)+1).to_s}*" "
}
#!ruby -an
puts [$F*" "]+%w(641 642 342 5342 142 1414 51414).select{|w|/#{("1".."6").map{|c|c+c*w.count(c)+"*"}*""}/=~$F.sort*""}
y/123456/ckmnou/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment