RosettaCodeData/Task/Extend-your-language/Ruby/extend-your-language-2.rb
2023-07-01 13:44:08 -04:00

12 lines
277 B
Ruby

[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
end