This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1234 test | |
testing more | |
another test | |
MADE IT awesome | |
DOUBLE FORK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |