Skip to content

Instantly share code, notes, and snippets.

View reneedv's full-sized avatar

Renée Hendricksen reneedv

View GitHub Profile
@reneedv
reneedv / table.rb
Created May 31, 2012 20:02 — forked from brookr/table.rb
A basic Table class
# Assignment: Fill in this Table class so the tests pass!
# Exercise Details:
#- Make a Table object class
#- Define at least 5 properties of a Table (legs, material, items_on_it, etc…)
#- Define an initialize method that sets one or more of the attributes when you call Table.new
#- Define a pretty_print method that prints out some useful information about your table
#- Email us a link to your code in a Gist
# Extra Credit:
@reneedv
reneedv / fizz_buzz.rb
Created June 12, 2012 19:34 — forked from quardox/fizz_buzz.rb
FizzBuzz Homework 1
# Write a Ruby script that prints the numbers from 1-100,
# replacing every multiple of 3 with the word Fizz,
# replacing every multiple of 5 with the word Buzz,
# and replacing every multiple of both with the word FizzBuzz
#
# My idea was to create an array of 1-100, then convert that to a string so I could use successive gsubs to replace the multiples with the correct words. When I try to run it I get "undefined method 'gsub' for #<Array>. I've discovered I'm a lot better at editing/adding to things that already exist than trying to set up a script from scratch. Not sure if I'm even on the right track here and I could definitely use your input. Thanks!
array = Array (1..100)
puts array
numbers = array.to_s