<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.refactormycode.com,2007:users1881</id>
  <link type="application/atom+xml" href="http://www.refactormycode.com/users/1881" rel="self"/>
  <title>jhindle</title>
  <updated>Fri Jan 15 13:08:12 -0800 2010</updated>
  <entry>
    <id>tag:www.refactormycode.com,2007:Code1145</id>
    <published>2010-01-15T13:08:12-08:00</published>
    <updated>2011-02-13T12:57:30-08:00</updated>
    <title>[Ruby] Fizz Buzz</title>
    <content type="html">&lt;p&gt;Wrote a Fizz Buzz &lt;a href="http://en.wikipedia.org/wiki/Bizz_buzz#Other_uses" target="_blank"&gt;http://en.wikipedia.org/wiki/Bizz_buzz#Other_uses&lt;/a&gt; solution in Ruby. It works but I'm sure it could be better/more concise.&lt;/p&gt;

&lt;pre&gt;101.times do |n|

  next if n == 0

  case true
    when (n%5) == 0 &amp;amp;&amp;amp; (n%3) == 0
      puts &amp;quot;fizzbuzz&amp;quot;
    when ((n%3) == 0)
      puts &amp;quot;fizz&amp;quot;
    when (n%5) == 0
      puts &amp;quot;buzz&amp;quot;
    else
      puts n
  end

end
&lt;/pre&gt;</content>
    <author>
      <name>jhindle</name>
      <email>james@ilovemakingthings.com </email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1145-fizz-buzz" rel="alternate"/>
  </entry>
</feed>

