Skip to content

Instantly share code, notes, and snippets.

🥓
ベーコンムシャムシャくん

Shoko Kato s-tammy-kato

🥓
ベーコンムシャムシャくん
Block or report user

Report or block s-tammy-kato

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@s-tammy-kato
s-tammy-kato / osyacode_fzbz.rb
Last active Apr 25, 2019
FizzBuzz with ruby
View osyacode_fzbz.rb
(1..ARGV[0].to_i).each do |i|
s = (i % 3).zero? ? 'Fizz' : ''
b = (i % 5).zero? ? 'Buzz' : ''
s << b
puts s.empty? ? i.to_s : s
end
View osyacode_gcd.rb
def mygcd(n, m)
return n if m.zero?
mygcd(m, n % m)
end
puts mygcd(ARGV[0].to_i, ARGV[1].to_i)
You can’t perform that action at this time.