class Bowling {

   public static int play(String gameFrame) {
      int score = 0;
      String[] splitGameFrame = gameFrame.replace("-", "0").split("\\|");

      for (int i = 0; i < splitGameFrame.length; i++) {
         final String frame = splitGameFrame[i];

         if (i < splitGameFrame.length - 1) {

            final String nextFrame = splitGameFrame[i + 1];

            score += computeFrameScore(frame, nextFrame);
         } else {
            score += computeFrameScore(frame, "--");
         }
      }

      return score;

   }

}