Created
May 19, 2014 23:33
-
-
Save jleo3/c0fed0debe759c0ff5b6 to your computer and use it in GitHub Desktop.
blargh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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