Skip to content

Instantly share code, notes, and snippets.

View RyanHedges's full-sized avatar
🕶️
You won't have a meaningful life without work, but it's not the meaning of life!

Ryan Hedges RyanHedges

🕶️
You won't have a meaningful life without work, but it's not the meaning of life!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryanhedges on github.
  • I am ryanhedges (https://keybase.io/ryanhedges) on keybase.
  • I have a public key ASCP0aLCsACQ0DAx_UHLqvlAT-IgCO0iREhWr-LFaxkxwQo

To claim this, I am signing this object:

@RyanHedges
RyanHedges / greed.rb
Created January 15, 2014 00:18
greed is good
# My solution -
# http://www.codewars.com/dojo/katas/5270d0d18625160ada0000e4/play/ruby
def score( dice )
points = 0
triplet = {1=>1000,2=>200,3=>300,4=>400,5=>500,6=>600}
(1..6).each do |i|
total = dice.count(i)
if total >= 3
points += triplet[i]
#https://github.com/RyanHedges/ar-student-schema
#This program created a students table in a database and tied it to a Student class. The class validated information and created a name and age method.
class Vehicle
attr_reader :color
def initialize(attributes)
@color = attributes[:color]
@wheels = attributes[:wheels]
@engine_status = :off
end
def drive
@stutus = :driving