From 20f2f6ec89d4dfbe4fc173d73d11e81f65d99da2 Mon Sep 17 00:00:00 2001 From: Walter Higgins Date: Thu, 3 Jan 2013 08:36:49 +0000 Subject: [PATCH] Update example_scripts/fort.js Exception message was incorrect and I've moved the size-check to just after the statement that increases size if odd. --- example_scripts/fort.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_scripts/fort.js b/example_scripts/fort.js index c75ba6f..6aa7304 100644 --- a/example_scripts/fort.js +++ b/example_scripts/fort.js @@ -8,11 +8,11 @@ Drone.extend('fort', function(side, height) side = 18; if (typeof height == "undefined") height = 6; - if (height < 4 || side < 10) - throw new java.lang.RuntimeException("Forts must be at least 9 wide X 4 tall"); // make sure side is even if (side%2) side++; + if (height < 4 || side < 10) + throw new java.lang.RuntimeException("Forts must be at least 10 wide X 4 tall"); var brick = 98; // // build walls.