Skip to content

Instantly share code, notes, and snippets.

@katiebuilds
Created January 13, 2015 16:32
Show Gist options
  • Save katiebuilds/52335c69980d1d798ee6 to your computer and use it in GitHub Desktop.
Save katiebuilds/52335c69980d1d798ee6 to your computer and use it in GitHub Desktop.
def fish_length(lower, upper)
return rand(upper) + lower
end
puts "What kind of fish did you catch?"
species = gets.chomp
puts "What is the biggest (in inches) that kind of fish can be?"
upper = gets.chomp.to_i
puts "How small (in inches) is the smallest fish you would keep?"
lower = gets.chomp.to_i
fish_length(lower, upper)
puts "Last week I caught an awesome #{species} that was #{fish_length} inches" +
"long!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment