Baseball exercise in ruby