Still got It
So as of late I feel like I’ve been concentrating so much on Rails, that I’ve let my Ruby slip, and while that’s probably true, I decided to do a quick test of my skills and see if I could still code ‘FizzBuzz’ just for fun. Luckily I was able to do so in about 10 minutes.
It feels strange on a coding journey, going from knowing something, to feeling like you know nothing, to acomplishing some (minor) things.
#initalize the counter
num = 0
#creating the loop and if statements for the math
while num <= 100
if num == 0
puts "num is 0, not divisible by 3 or 5"
elsif num % 3 == 0 && num % 5 == 0
puts "FizzBuzz"
puts "#{num} is divisible by 3 AND 5"
elsif num % 3 == 0
puts "Fizz"
puts "#{num} is divisible by 3"
elsif num % 5 == 0
puts "Buzz"
puts "#{num} is divisible by 5"
else
puts "#{num} is divisible by neither 3 nor 5"
end
num += 1
end
So far on my coding journey I feel like I’m on the downhill part of the following image:
It’s nice to have something to look forward to and know that my skills will only improve.
Written on August 10, 2016