Skip to content

Instantly share code, notes, and snippets.

1234 test
testing more
another test
MADE IT awesome
DOUBLE FORK
@SamSaffron
SamSaffron / agari.rb
Created January 3, 2012 23:33 — forked from shokai/README.md
清一色のアガリのみ出力する
#!/usr/bin/env ruby
def agari?(pais, pairs=4)
h = Hash.new(0)
pais.each do |x|
h[x] += 1
end
v = h.values
if v.min == 2 and v.count(2) == 1 and v.max == 3 and v.count(3) == pairs
return true
else