Skip to content

Instantly share code, notes, and snippets.

@bryanbibat
Created May 7, 2012 05:23
Show Gist options
  • Save bryanbibat/2626072 to your computer and use it in GitHub Desktop.
Save bryanbibat/2626072 to your computer and use it in GitHub Desktop.
assessment test spoilers
class Animal
def initialize(name, age)
@name, @age = name, age
end
def getName
@name
end
def getAge
@age
end
end
class Dog < Animal
def getAge
@age * 7
end
end
puts (1..500).select { |x| x % 2 == 0 && x % 3 == 0 }
require 'sinatra'
set :port, 80 # also need to run this program as root
get '/' do
"Hello World"
end
puts "enter sentence"
sentence = gets.chomp.downcase.gsub(" ", "")
puts "sentence is #{ sentence.reverse == sentence ? "a" : "not a"} palindrome"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment