(no title)
cHaOs667 | 6 months ago
class Mess
OUTPUTS = {
1 => ->(i) { i.odd? ? "odd" : "even" },
2 => ->(_) { "trying" },
3 => ->(_) { "other" }
}.freeze
def chaos(x)
return puts "negative" unless x.positive?
[1, 2, 3].each do |i|
puts OUTPUTS[i]&.call(i) || "other"
end
end
end
cHaOs667|6 months ago
Jtsummers|6 months ago