package RCX4; import josx.platform.rcx.*; import josx.robotics.*; /** *Manages primary directives. */ class PrettyBoy { public static boolean lightFlag; //create instances of behaviors public static FollowTheBlackLine b1 = new FollowTheBlackLine(); public static ObjectNear b2 = new ObjectNear(); public static Behavior [] bArray = {b1,b2};//insert behaviors into arbitrator array public static Arbitrator arby = new Arbitrator(bArray);//initialze arbitrator public static void main(String [] args) throws Exception { Senses.init(); Pilot.init(); TextLCD.print("GO?"); try{ Button.VIEW.waitForPressAndRelease(); }catch (InterruptedException ie){} lightFlag = Senses.getBlackOrWhite();//set initial Black/White state arby.start();//start arbitrator try{ Button.RUN.waitForPressAndRelease(); }catch (InterruptedException ie){} Senses.deactivateSensors(); }//main }//PrettyBoy