- try {
- int st = s.nextInt();
- s.useDelimiter(eol);
- if (s.hasNext(rest))
- messageString = s.next(rest);
- return st;
- }
- catch (InputMismatchException e) { throw new NumberFormatException(); }
- catch (NoSuchElementException e) { throw new NumberFormatException(); }
+ try { messageString = getOutputs().get(0); }
+ catch (TimeoutException e) { type = Action.Timeout; return; }
+
+ Scanner s = new Scanner(messageString);
+ try { stoneThrow = s.nextInt(); }
+ catch (InputMismatchException e) { type = Action.Invalid; return; }
+ catch (NoSuchElementException e) { type = Action.Invalid; return; }
+
+ s.useDelimiter(eol);
+ if (s.hasNext(rest)) messageString = s.next(rest);
+ else messageString = "";
+ type = Action.Throw;