On Jul 18, 2007, at 6:05 AM, Matthew Borgeson wrote:

> The problem here is I have written all of the mathematical  
> operations I need
> in blocks like this, but I dont know how to make them accomodate  
> for invalid
> answers.

I recommend using a library to make sure you only get valid answers:

Firefly:~/Desktop$ ruby gender.rb
What gender is your patient?  dog
You must choose one of [:male, :female].
?  male
:male
Firefly:~/Desktop$ ruby gender.rb
What gender is your patient?  f
:female
Firefly:~/Desktop$ cat gender.rb
#!/usr/bin/env ruby -wKU

require "rubygems"
require "highline/import"

gender = ask("What gender is your patient?  ", [:male, :female])
p gender

__END__

James Edward Gray II