Skip to content

Instantly share code, notes, and snippets.

View SpaYco's full-sized avatar
🏠
Available for remote jobs

Aziz Mejri SpaYco

🏠
Available for remote jobs
View GitHub Profile
######## Make any even/odd calculator with this method ########
######################## Get Crazy ###########################
def getCrazy(n)
result = "case x\n"
1..n.times do |number|
result += " when #{number}\n"
result += " p '#{number % 2 == 0 ? 'even': 'odd'}'\n"