Skip to content

Instantly share code, notes, and snippets.

View steven-ferguson's full-sized avatar

steven-ferguson

  • Dave
  • Los Angeles, CA
View GitHub Profile
class Board
attr_reader :columns, :height, :width
def initialize(width, height)
@columns = []
@height = height
@width = width
width.times do |position|
column = Column.new(position, height)
columns << column
class Board
def initialize(grid_length)
@spaces = []
@grid_length = grid_length
create_spaces
end
attr_reader :spaces, :grid_length
def create_spaces
class Address
def initialize
@street
@city
@state
@type
end
def complete_address
"#{@street} #{@city}, #{@state}"
require './lib/triangles'
def main
@sides = []
puts "Please enter a side length"
@sides << gets.chomp
puts "Please enter another side length"
@sides << gets.chomp
puts "Please enter a third side length"
class Parcel
def initialize(weight, height, width, length)
@weight = weight
@height = height
@width = width
@length = length
@dimensional_weight = (@length * @width * @height)/ 166
end
def dimensional_weight
require 'date'
class Task
def initialize(description)
@description = description
@status = "incomplete"
@priority = 5
@due_date = Date.today.to_s
end
class Die
def initialize(number_of_sides)
@number_of_sides = number_of_sides
end
def sides
@number_of_sides
end
def roll