Back to Blogging

Okay, I’m trying out the new WordPress.Com OS X application for blogging. Maybe this will get me back in the mood for blogging at least once per week. One thing I will need ot change is my theme.


FizzBuzz in Sinatra

The other night I attended the Ruby MKE Meetup. The topic was the 7 Degrees of FizzBuzz by Bill Gathen. Unfortunately, we weren’t able to get to the final “degree” before the end of the meeting. So, for those who are interested, here is my solution:

require 'sinatra'

get '/' do
  erb :index

@@ index

    <% (1..99).each do |x| %>
    <%= ("fizzbuzz" if x % 15 == 0) ||         ("fizz" if x % 3 == 0) ||         ("buzz" if x % 5 == 0) ||         x %>

    <% end %>