RosettaCodeData/Task/Extend-your-language/Ruby/extend-your-language-2.rb

13 lines
277 B
Ruby
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
[true,false].product([true,false]).each do |cond1, cond2|
print "%5s, %5s => " % [cond1, cond2]
if2(cond1, cond2) do
puts "both true"
end.else1 do
puts "first is true"
end.else2 do
puts "second is true"
end.neither do
puts "neither is true"
end
2013-04-10 16:57:12 -07:00
end