// This Java file was automatically generated by ToonTalk for August 7 import ap.toontalk.*; // Robot2302_149176563: Done Spawning class Robot2302_149176563 extends TTRobot { Robot2302_149176563(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { if (!wants.matches(given)) return null; // If given a box that matches the box in his thought bubble (called "wants"), // this robot will do the following: TTObject hand; // grab a copy of Dusty TTVacuum vacuum = new TTVacuum(); hand = vacuum; // use Dusty to vacuum his box throw new TTException("A robot vacuumed up his box."); } } // Robot2301_2169266325: Spawn Each class Robot2301_2169266325 extends TTRobot { Robot2301_2169266325(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { TTObject hand; TTObject temp1; TTObject temp2; TTObject temp3; // move to the stack of trucks temp1 = new TTTruck(this); // pick up a truck hand = temp1; // drop it temp1 = hand; // pick up what's in the first hole inside his box hand = given.pickUp(0); // drop it into the truck which is the new truck temp1.gets(hand); // pick up what's in the second hole inside his box hand = given.pickUp(1); // drop it into the truck which is the new truck temp1.gets(hand); // pick up his box hand = given; // push '2' while pointing to his box temp2 = given.keyboard('2', false, false); given.stoppedTyping(); // drop it // grab a copy of Dusty TTVacuum vacuum = new TTVacuum(); hand = vacuum; // switch to working on the new box TTObject old_given = given; given = temp2; temp3 = old_given; // use Dusty to vacuum the last thing he made or found vacuum.suckUp(temp3); // release Dusty old_given.becomes(given); return this; // This robot has finished and will give the box to the first robot to try again. } } // Robot2299_1727549570: Grapher class Robot2299_1727549570 extends TTRobot { Robot2299_1727549570(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { if (!wants.matches(given)) return null; // If given a box that matches the box in his thought bubble (called "wants"), // this robot will do the following: TTObject hand; TTObject temp1; TTObject temp2; TTObject temp3; TTObject temp4; TTObject temp5; TTObject temp6; TTObject temp7; TTObject temp8; TTObject temp9; TTObject temp10; TTObject temp11; TTObject temp12; TTObject temp13; TTObject temp14; TTObject temp15; // grab a magic wand TTCopier copier = new TTCopier(); hand = copier; // use the magic wand on the second hole inside his box hand = copier.applyTo(given.hole(1), this); temp1 = hand; // drop it temp1 = hand; // release the magic wand // pick up the first thing he made or found hand = temp1; // use it temp2 = TTNotebook.getLocalRemotesNotebook(); temp2.setControlee(hand); hand.use(); // drop it temp1 = hand; // pick up what's on the right page of the new notebook temp3 = temp2.pickUp(1); hand = temp3; // drop it temp3 = hand; // push the space bar after moving to the new notebook temp2.keyboard(' ', true, false); temp2.stoppedTyping(); // pick up what's on the right page of the new notebook temp4 = temp2.pickUp(1); hand = temp4; // drop it temp4 = hand; // push the space bar after moving to the new notebook temp2.keyboard(' ', true, false); // push the space bar after moving to the new notebook temp2.keyboard(' ', true, false); // push the space bar after moving to the new notebook temp2.keyboard(' ', true, false); temp2.stoppedTyping(); // pick up what's on the right page of the new notebook temp5 = temp2.pickUp(1); hand = temp5; // drop it temp5 = hand; // push the space bar after moving to the new notebook temp2.keyboard(' ', true, false); temp2.stoppedTyping(); // pick up what's on the right page of the new notebook temp6 = temp2.pickUp(1); hand = temp6; // drop it temp6 = hand; // pick up the first thing he made or found hand = temp1; // use it hand.use(); // drop it on the first hole inside his box given.holeGets(0, hand); // grab a magic wand hand = copier; // use the magic wand on the third hole inside his box hand = copier.applyTo(given.hole(2), this); temp7 = hand; // push '=' to change what he is holding hand.keyboard('=', false, false); hand.stoppedTyping(); // drop what he just copied on the first hole inside the newest box temp5.holeGets(0, hand); // release the magic wand // pick up what's in the fourth hole inside his box hand = given.pickUp(3); // drop it temp8 = hand; // grab a magic wand hand = copier; // use the magic wand on the fifth hole inside his box hand = copier.applyTo(given.hole(4), this); // drop what he just copied on the eighth thing he made or found temp8.gets(hand); // use the magic wand on the eighth thing he made or found hand = copier.applyTo(temp8, this); temp9 = hand; // push '=' to change what he is holding hand.keyboard('=', false, false); hand.stoppedTyping(); // drop what he just copied on the first hole inside the newest box temp6.holeGets(0, hand); // release the magic wand // move to the stack of numbers temp11 = new TTNumber(1); // pick up a number hand = temp11; // push Backspace key to change what he is holding hand.keyboard('\b', false, false); // push '/' to change what he is holding hand.keyboard('/', false, false); // push '2' to change what he is holding hand.keyboard('2', false, false); hand.stoppedTyping(); // drop it on the eighth thing he made or found temp8.gets(hand); // pick up the eighth thing he made or found hand = temp8; // push '=' to change what he is holding hand.keyboard('=', false, false); hand.stoppedTyping(); // drop it on the first hole inside the newest box temp4.holeGets(0, hand); // grab a magic wand hand = copier; // use the magic wand on the third hole inside his box hand = copier.applyTo(given.hole(2), this); temp12 = hand; // drop it temp12 = hand; // use the magic wand on the sixth hole inside his box hand = copier.applyTo(given.hole(5), this); temp13 = hand; // drop it temp13 = hand; // release the magic wand // move to the stack of numbers temp14 = new TTNumber(1); // pick up a number hand = temp14; // push Backspace key to change what he is holding hand.keyboard('\b', false, false); // push '/' to change what he is holding hand.keyboard('/', false, false); // push '2' to change what he is holding hand.keyboard('2', false, false); hand.stoppedTyping(); // drop it on the fourth to last thing he made or found temp12.gets(hand); // pick up the fourth to last thing he made or found hand = temp12; // drop it on the third to last thing he made or found temp13.gets(hand); // pick up the third to last thing he made or found hand = temp13; // push '=' to change what he is holding hand.keyboard('=', false, false); hand.stoppedTyping(); // drop it on the first hole inside the newest box temp3.holeGets(0, hand); // grab a magic wand hand = copier; // use the magic wand on the third hole inside his box hand = copier.applyTo(given.hole(2), this); // drop what he just copied on the sixth hole inside his box given.holeGets(5, hand); // release the magic wand // grab a copy of Dusty TTVacuum vacuum = new TTVacuum(); hand = vacuum; // push '1' while pointing to Dusty vacuum.keyboard('1', false, false); vacuum.stoppedTyping(); // use Dusty to vacuum the newest box vacuum.suckUp(temp3); // use Dusty to vacuum the newest box vacuum.suckUp(temp4); // use Dusty to vacuum the newest box vacuum.suckUp(temp5); // use Dusty to vacuum the newest box vacuum.suckUp(temp6); // release Dusty return this; // This robot has finished and will see if the box still matches his thoughts and try again. } } // Robot2303_1546727554: Stop Ready to start again class Robot2303_1546727554 extends TTRobot { Robot2303_1546727554(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { if (!wants.matches(given)) return null; // If given a box that matches the box in his thought bubble (called "wants"), // this robot will do the following: TTObject hand; TTObject temp1; // push '.' while pointing to the first hole inside his box given.hole(0).keyboard('.', false, false); given.hole(0).stoppedTyping(); // move to the stack of numbers temp1 = new TTNumber(1); // pick up a number hand = temp1; // push Backspace key to change what he is holding hand.keyboard('\b', false, false); // push '=' to change what he is holding hand.keyboard('=', false, false); // push '0' to change what he is holding hand.keyboard('0', false, false); hand.stoppedTyping(); // drop it on the sixth hole inside his box given.holeGets(5, hand); return this; // This robot has finished and will give the box to the first robot to try again. } } // Robot719_36974814: Add up class Robot719_36974814 extends TTRobot { Robot719_36974814(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { if (!wants.matches(given)) return null; // If given a box that matches the box in his thought bubble (called "wants"), // this robot will do the following: TTObject hand; TTObject temp1; // pick up what's in the first hole inside his box hand = given.pickUp(0); // drop it on the second hole inside his box given.holeGets(1, hand); // grab a magic wand TTCopier copier = new TTCopier(); hand = copier; // use the magic wand on the second hole inside his box hand = copier.applyTo(given.hole(1), this); // give what he just copied to the bird in the third hole inside his box given.hole(2).gets(hand); // release the magic wand return this; // This robot has finished and will see if the box still matches his thoughts and try again. } } // Robot2300_966463650: Inverse squares class Robot2300_966463650 extends TTRobot { Robot2300_966463650(TTNotebook n) { notebook = n; } public TTObject gets(TTObject given) throws TTException { if (!wants.matches(given)) return null; // If given a box that matches the box in his thought bubble (called "wants"), // this robot will do the following: TTObject hand; TTObject temp1; TTObject temp2; TTObject temp3; // grab a magic wand TTCopier copier = new TTCopier(); hand = copier; // use the magic wand on the first hole inside his box hand = copier.applyTo(given.hole(0), this); temp1 = hand; // drop it temp1 = hand; // release the magic wand // move to the stack of numbers temp2 = new TTNumber(1); // pick up a number hand = temp2; // push Backspace key to change what he is holding hand.keyboard('\b', false, false); // push '^' to change what he is holding hand.keyboard('^', false, false); // push '-' to change what he is holding hand.keyboard('-', false, false); // push '2' to change what he is holding hand.keyboard('2', false, false); hand.stoppedTyping(); // drop it on the first thing he made or found temp1.gets(hand); // pick up the first thing he made or found hand = temp1; // give it to the bird in the second hole inside his box given.hole(1).gets(hand); // move to the stack of numbers temp3 = new TTNumber(1); // pick up a number hand = temp3; // drop it on the first hole inside his box given.holeGets(0, hand); return this; // This robot has finished and will see if the box still matches his thoughts and try again. } } public class GrapherDemo extends TTApplet { public static void main(String args[]) { new TTFrame().begin(new GrapherDemo()); } public void initialize() { intializeToonTalkImages(); intializeNests(); TTNotebook notebook = TT.NOTEBOOK; TTRobot next_robot; TTPicture picture2 = new TTRectangle(500, 500, 1000, 1000, 0, 0, 128, 128, 128, true, true, false); setPicture(picture2); picture2.addPicture(GrapherDemo.PicturePart1(notebook, picture2)); picture2.start(); screen_snapshot_file_name = "GrapherDemo.gif"; } public static TTPicture PicturePart1(TTNotebook notebook, TTPicture container) { TTPicture picture3 = new TTGIFPicture("mdhmmlboneboljbghbkgadieckefinmi.gif", false, 500, 500, 1000, 1000, 0, 0, true, true, false); TTBox box4 = new TTBox(4); // Robot2300_966463650: Inverse squares TTRobot robot5 = new Robot2300_966463650(notebook); TTBox box6 = new TTBox(2); TTBox wants1 = box6; // This robot will only accept a box with 2 holes. The hole labeled with "n" // contains any number. The second hole contains a bird. wants1.setHole(0, TT.BLANK_NUMBER); wants1.setHole(1, new TTBird()); robot5.setWants(wants1); TTBox box7 = new TTBox(2); // Robot719_36974814: Add up TTRobot robot8 = new Robot719_36974814(notebook); TTBox box9 = new TTBox(3); TTBox wants2 = box9; // This robot will only accept a box with 3 holes. The hole labeled with "in" // contains any number. The hole labeled with "so far" contains any number. // The hole labeled with "out" contains a bird. wants2.setHole(0, TT.BLANK_NUMBER); wants2.setHole(1, TT.BLANK_NUMBER); wants2.setHole(2, new TTBird()); robot8.setWants(wants2); TTBox box10 = new TTBox(3); box4.setHole(0, robot5); TTBox wants3 = box6; // This robot will only accept a box with 2 holes. The hole labeled with "n" // contains any number. The second hole contains a bird. box4.hole(0).setWants(wants3); box4.setHole(1, box7); box4.hole(1).setHole(0, new TTNumber(2, TT.NO_NUMBER_OPERATION, 0, 0, 0)); box4.hole(1).setHole(1, new TTBird()); box4.hole(1).hole(1).setNest(nest0); box4.setHole(2, robot8); TTBox wants4 = box9; // This robot will only accept a box with 3 holes. The hole labeled with "in" // contains any number. The hole labeled with "so far" contains any number. // The hole labeled with "out" contains a bird. box4.hole(2).setWants(wants4); box4.setHole(3, box10); box4.hole(3).setHole(0, nest0); box4.hole(3).setHole(1, new TTNumber(0, TT.NO_NUMBER_OPERATION, 0, 0, 0)); box4.hole(3).setHole(2, new TTBird()); box4.hole(3).hole(2).setNest(nest1); // We just made a box with 4 holes. The hole labeled with "Fractions" // contains a robot who wants a box with 2 holes. The hole labeled with "n" // contains any number. The second hole contains a bird. If given a box like // that he will grab a magic wand. And use the magic wand on the first hole // inside his box. And drop it. And release the magic wand. And move to the // stack of numbers. And pick up a number. And push Backspace key to change // what he is holding. And push '^' to change what he is holding. And push // '-' to change what he is holding. And push '2' to change what he is // holding. And drop it on the first thing he made or found. And pick up the // first thing he made or found. And give it to the bird in the second hole // inside his box. And move to the stack of numbers. And pick up a number. // And drop it on the first hole inside his box. The second hole contains a // box with 2 holes. The first hole contains the integer 2. The second hole // contains a bird. The hole labeled with "Running Totals" contains a robot // who wants Th TTRobot robot11 = new Robot2302_149176563(notebook); TTBox box12 = new TTBox(0); TTBox wants5 = box12; // This robot will only accept a box with 0 holes. robot11.setWants(wants5); TTTeam team11 = new TTTeam(box4, robot11); TTRobot robot13 = new Robot2301_2169266325(notebook); robot11.setNextRobot(robot13); picture3.addTeam(team11); TTBox box14 = new TTBox(8); TTPicture picture15 = new TTRemoteLooks(picture3, 500, 500, 1000, 1000, 0, 0, true, true, false); TTPicture picture16 = new TTGIFPicture("adepndgaihjjlmfglfigampjhgalefjb.gif", false, 500, 500, 1000, 1000, 0, 0, false, true, false); box14.setHole(0, picture15); box14.setHole(1, picture16); box14.setHole(2, new TTNumber(10, TT.NO_NUMBER_OPERATION, 0, 0, 0)); box14.setHole(3, nest1); box14.setHole(4, new TTNumber(1000, TT.MULTIPLY_BY, 0, 0, 0)); box14.setHole(5, new TTNumber(0, TT.NO_NUMBER_OPERATION, 0, 0, 0)); box14.setHole(6, new TTScale('<')); box14.setHole(7, new TTNumber(1000, TT.NO_NUMBER_OPERATION, 0, 0, 0)); // We just made a box with 8 holes. The hole labeled with "Looks" contains a // remote control for another's looks - a picture that reminds me of "I make // a bar graph of he inverse squares series" . The picture is a picture from // a file (grid[1]) . The first thing on the back is a pad with the text // "GrapherDemo" on it. And the second thing on the back is a box with 4 // holes. The hole labeled with "Fractions" contains a robot who wants a box // with 2 holes. The hole labeled with "n" contains any number. The second // hole contains a bird. If given a box like that he will grab a magic wand. // And use the magic wand on the first hole inside his box. And drop it. And // release the magic wand. And move to the stack of numbers. And pick up a // number. And push Backspace key to change what he is holding. And push '^' // to change what he is holding. And push '-' to change what he is holding. // And push '2' to change what he is holding. And drop it on the first thing // he made or found. And pick up the first thing he made or found. And give TTRobot robot18 = new Robot2299_1727549570(notebook); TTBox box19 = new TTBox(8); TTBox wants6 = box19; // This robot will only accept a box with 8 holes. The hole labeled with // "Looks" contains a picture that reminds me of "I make a bar graph" . The // picture is any picture (for example, a picture from a file (grid[1]) a // picture from a file. The hole labeled with "Bar" contains any picture (for // example, a picture from a file (color_line) a picture from a file. The // hole labeled with "Width" contains any number. The hole labeled with "Data // in" contains any number. The hole labeled with "Operation" contains any // number. The hole labeled with "X" contains any number. The seventh hole // contains a scale tipped to the right. The hole labeled with "Max" contains // any number. wants6.setHole(0, TT.BLANK_PICTURE); wants6.setHole(1, TT.BLANK_PICTURE); wants6.setHole(2, TT.BLANK_NUMBER); wants6.setHole(3, TT.BLANK_NUMBER); wants6.setHole(4, TT.BLANK_NUMBER); wants6.setHole(5, TT.BLANK_NUMBER); wants6.setHole(6, new TTScale('<')); wants6.setHole(7, TT.BLANK_NUMBER); robot18.setWants(wants6); TTTeam team18 = new TTTeam(box14, robot18); TTRobot robot21 = new Robot2303_1546727554(notebook); TTBox box22 = new TTBox(8); TTBox wants7 = box22; // This robot will only accept a box with 8 holes. The hole labeled with // "Looks" contains a picture that reminds me of "I make a bar graph" . The // picture is any picture (for example, a picture from a file (grid[1]) a // picture from a file. The hole labeled with "Bar" contains any picture (for // example, a picture from a file (color_line) a picture from a file. The // hole labeled with "Width" contains any number. The hole labeled with "Data // in" contains any number. The hole labeled with "Operation" contains any // number. wants7.setHole(0, TT.BLANK_PICTURE); wants7.setHole(1, TT.BLANK_PICTURE); wants7.setHole(2, TT.BLANK_NUMBER); wants7.setHole(3, TT.BLANK_NUMBER); wants7.setHole(4, TT.BLANK_NUMBER); wants7.setHole(5, new TTNothing("X")); wants7.setHole(6, TT.NOTHING); wants7.setHole(7, new TTNothing("Max")); robot21.setWants(wants7); robot18.setNextRobot(robot21); picture3.addTeam(team18); TTObject temp0 = new TTText("GrapherDemo"); picture3.addOnBack(temp0); return picture3; } protected static TTNest nest0; protected static TTNest nest1; private void intializeNests() { nest0 = new TTNest("fractions"); nest1 = new TTNest("Data"); } private void intializeToonTalkImages() { } }