Skip to content

Instantly share code, notes, and snippets.

@jleo3
Created May 19, 2014 23:33
Show Gist options
  • Save jleo3/c0fed0debe759c0ff5b6 to your computer and use it in GitHub Desktop.
Save jleo3/c0fed0debe759c0ff5b6 to your computer and use it in GitHub Desktop.
blargh
class Teddit
def add_story
puts "Please enter a News story:"
story = get_input
puts "Please give it a category:"
category = get_input
upvotes = calculate_upvotes(story, category)
puts "New story added! #{story}, Category: #{category.capitalize}, Current Upvotes: #{upvotes}"
end
def welcome
puts "Welcome to Teddit! a text based news aggregator. Get today's news tomorrow!"
end
def get_input
#Get input from the user.
end
def calculate_upvotes(story, category)
# Write code so that:
# If the Story is about cats multiply the upvotes by 5
# If the Story is about bacon multiply the upvotes by 8
# If the Story is about Food it gets 3 times the upvotes.
#For example:
# "Cats frolic despite tuna shortage" should give you 5 times the upvotes!
end
end
teddit = Teddit.new
teddit.add_story
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment