[ create a new paste ] login | about

Link: http://codepad.org/P9Bsv3Vd    [ raw code | output | fork ]

Ruby, pasted on Oct 14:
1
2
3
4
5
6
7
h1 = { "a" => "A", "b" => "X"}
h2 = { "a" => "X", "b" => "M"}
h3 = { "a" => "L", "b" => "M"}

puts(h1.values.all? {|s| (s =~ /^[ASX]$/) != nil })
puts(h2.values.all? {|s| (s =~ /^[ASX]$/) != nil })
puts(h3.values.all? {|s| (s =~ /^[ASX]$/) != nil })


Output:
1
2
3
true
false
false


Create a new paste based on this one


Comments: