# パラメーターにより出力を変える
## paramsが`:even`のとき偶数のみ表示する
## paramsが`:odd`のとき奇数のみを表示する
## それ以外は全部表示する
def show_numbers(params)
list = %w(18 22 11 73 91 38 24 17)
list.each do |element|
case params
when :even
if element.to_i.even?
puts element
end
when :odd
if element.to_i.odd?
puts element
end
else
puts element
end
end
end
puts '#### :odd ####'
show_numbers(:odd)
puts '#### :even ####'
show_numbers(:even)
puts '#### :ohter ####'
show_numbers(:other)
IyDjg5Hjg6njg6Hjg7zjgr/jg7zjgavjgojjgorlh7rlipvjgpLlpInjgYjjgosKIyMgcGFyYW1z44GMYDpldmVuYOOBruOBqOOBjeWBtuaVsOOBruOBv+ihqOekuuOBmeOCiwojIyBwYXJhbXPjgYxgOm9kZGDjga7jgajjgY3lpYfmlbDjga7jgb/jgpLooajnpLrjgZnjgosKIyMg44Gd44KM5Lul5aSW44Gv5YWo6YOo6KGo56S644GZ44KLCgpkZWYgc2hvd19udW1iZXJzKHBhcmFtcykKICBsaXN0ID0gJXcoMTggMjIgMTEgNzMgOTEgMzggMjQgMTcpCiAgbGlzdC5lYWNoIGRvIHxlbGVtZW50fAogICAgY2FzZSBwYXJhbXMKICAgICAgd2hlbiA6ZXZlbgogICAgICAgIGlmIGVsZW1lbnQudG9faS5ldmVuPwogICAgICAgICAgcHV0cyBlbGVtZW50CiAgICAgICAgZW5kCiAgICAgIHdoZW4gOm9kZAogICAgICAgIGlmIGVsZW1lbnQudG9faS5vZGQ/CiAgICAgICAgICBwdXRzIGVsZW1lbnQKICAgICAgICBlbmQKICAgICAgZWxzZQogICAgICAgIHB1dHMgZWxlbWVudAogICAgZW5kCiAgZW5kCmVuZAoKcHV0cyAnIyMjIyA6b2RkICMjIyMnCnNob3dfbnVtYmVycyg6b2RkKQpwdXRzICcjIyMjIDpldmVuICMjIyMnCnNob3dfbnVtYmVycyg6ZXZlbikKcHV0cyAnIyMjIyA6b2h0ZXIgIyMjIycKc2hvd19udW1iZXJzKDpvdGhlcik=