refactor rubies.rb game method into smaller methods