Last active
August 29, 2015 14:15
-
-
Save umar-webonise/953cd1946332cc05966e to your computer and use it in GitHub Desktop.
Tit For Tat Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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