7 2 7 7 2 public void mysteryinstruction

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; move(); turnAround(); } 3 class FenceBuilder extends BasicRobot { public void faceNorth() { while ( !facingNorth() ) turnLeft(); } public void goToBeepers() { while ( !anyBeepersInCorner() ) move(); } public void pickAllBeepersInCorner() { while ( anyBeepersInCorner() ) pickBeeper(); } public void turnRight() { iterate 3 times turnLeft(); } public void goToRoom() { } } public void main() { FenceBuilder karel = new FenceBuilder(1, 1, , 0); karel.faceNorth(); karel.goToBeepers(); karel.pickAllBeepersInCorner(); karel.turnRight(); karel.goToRoom(); karel.buildFence(); karel.goBackToStart(); karel.turnRight(); karel.turnOff(); }...
View Full Document

Ask a homework question - tutors are online