Skip to content

Instantly share code, notes, and snippets.

@matoni109
Created October 2, 2020 04:26
Show Gist options
  • Save matoni109/b5e98ca861adb14237ebc68c6d9d6a45 to your computer and use it in GitHub Desktop.
Save matoni109/b5e98ca861adb14237ebc68c6d9d6a45 to your computer and use it in GitHub Desktop.
def colorful? (number)
colorful_numbers = [ 0, 1, 23, 263, 987 ]
#not_colorful_numbers = [ 10, 236, 999 ]
if number != number.to_i
return false
elsif colorful_numbers.include?(number)
return true
else
return false
end
end
# TODO: return true if the number is colorful, false otherwise
# 0 - 999 range ??
# if number != number.to_i
# return false
# else
# end
# https://stackoverflow.com/questions/52761236/methods-around-colorful-numbers
# Date.today.yday
# Date.today.next_year.to_s
#ef reverse_num(num)
# https://github.com/shruthi-venkateswaran/ruby/blob/master/colourful.rb
# def colorful? (number)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment