Skip to content

Instantly share code, notes, and snippets.

@umar-webonise
Last active August 29, 2015 14:15
Show Gist options
  • Save umar-webonise/953cd1946332cc05966e to your computer and use it in GitHub Desktop.
Save umar-webonise/953cd1946332cc05966e to your computer and use it in GitHub Desktop.
Tit For Tat Solution
(1..100).each do |num|
result = 'Tit' if num % 3 == 0
if num % 5 == 0
result &&= result + 'ForTat'
result ||= 'Tat'
end
result ||= num
puts result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment