def filter(list, params)
result = []
list.each do |element|
case params
when :aho
if element.include?('3') || element.to_i.modulo(3) == 0
result << element
end
when :even
if element.to_i.even?
result << element
end
when :odd
if element.to_i.odd?
result << element
end
else
result << element
end
end
result
end
def show_html(list)
puts '<html>'
puts ' <ul>'
list.each do |element|
puts " <ui>#{element}</ui>"
end
puts ' </ul>'
puts '</html>'
end
#### :even #####
list = %w(18 22 11 73 91 38 24 17)
filtered_list = filter(list, :even)
show_html(filtered_list)
ZGVmIGZpbHRlcihsaXN0LCBwYXJhbXMpCiAgcmVzdWx0ID0gW10KICBsaXN0LmVhY2ggZG8gfGVsZW1lbnR8CiAgICBjYXNlIHBhcmFtcwogICAgICB3aGVuIDphaG8KICAgICAgICBpZiBlbGVtZW50LmluY2x1ZGU/KCczJykgfHwgZWxlbWVudC50b19pLm1vZHVsbygzKSA9PSAwCiAgICAgICAgICByZXN1bHQgPDwgZWxlbWVudAogICAgICAgIGVuZAogICAgICB3aGVuIDpldmVuCiAgICAgICAgaWYgZWxlbWVudC50b19pLmV2ZW4/CiAgICAgICAgICByZXN1bHQgPDwgZWxlbWVudAogICAgICAgIGVuZAogICAgICB3aGVuIDpvZGQKICAgICAgICBpZiBlbGVtZW50LnRvX2kub2RkPwogICAgICAgICAgcmVzdWx0IDw8IGVsZW1lbnQKICAgICAgICBlbmQKICAgICAgZWxzZQogICAgICAgIHJlc3VsdCA8PCBlbGVtZW50CiAgICBlbmQKICBlbmQKICByZXN1bHQKZW5kCgpkZWYgc2hvd19odG1sKGxpc3QpCiAgcHV0cyAnPGh0bWw+JwogIHB1dHMgJyAgPHVsPicKICBsaXN0LmVhY2ggZG8gfGVsZW1lbnR8CiAgICBwdXRzICIgICAgPHVpPiN7ZWxlbWVudH08L3VpPiIKICBlbmQKICBwdXRzICcgIDwvdWw+JwogIHB1dHMgJzwvaHRtbD4nCmVuZAoKIyMjIyA6ZXZlbiAjIyMjIwpsaXN0ID0gJXcoMTggMjIgMTEgNzMgOTEgMzggMjQgMTcpCgpmaWx0ZXJlZF9saXN0ID0gZmlsdGVyKGxpc3QsIDpldmVuKSAKc2hvd19odG1sKGZpbHRlcmVkX2xpc3Qp