bot
Class FaultyBot

java.lang.Object
  extended bybot.Bot
      extended bybot.FaultyBot
Direct Known Subclasses:
FaultySpinBot, FaultySpiralBot

public abstract class FaultyBot
extends Bot

This is a bot that fails to do its various tasks upon occasion. You can restore functionality via restoreFeeler, restoreWallFeeler, restoreCompass, etc.


Field Summary
 
Fields inherited from class bot.Bot
board
 
Constructor Summary
FaultyBot()
          The constructor does nothing.
 
Method Summary
 Thing feel()
          ACTION: Feel in direction bot is facing.
 int getHeading()
          Maybe return correct heading... if compass is not broken.
 Thing grab()
          Grabs the thing in front of bot.
 void left()
          Turn left 90 degrees.
 void place(Thing t)
          Place a thing in the square I am standing on.
protected  void restoreCompass()
           
protected  void restoreFeeler()
           
protected  void restoreGrabber()
           
protected  void restorePlacer()
           
protected  void restoreStepper()
           
protected  void restoreTurner()
           
protected  void restoreWallFeeler()
           
 void right()
          Turn right 90 degrees.
 void say(String s)
          Say the string.
 void step()
          Take a single step in the current direction.
 void turn()
           
 
Methods inherited from class bot.Bot
compute, drop, feelKey, feelPit, feelWall, getBoard, getBotBoard, getInformer, getInput, getInputCharacter, getIntFromHuman, getLocation, getStringFromHuman, rest, say, say, say, say, setAppearance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaultyBot

public FaultyBot()
The constructor does nothing.

Method Detail

step

public final void step()
                throws BotException
Take a single step in the current direction.

Overrides:
step in class Bot
Throws:
BotException

grab

public final Thing grab()
Grabs the thing in front of bot. Will crash if there is nothing, or if there is a wall.

Overrides:
grab in class Bot

feel

public final Thing feel()
Description copied from class: Bot
ACTION: Feel in direction bot is facing. Does not feel board's actors.

Overrides:
feel in class Bot
Returns:
the Thing felt by bot. If there is nothing there, returns null. If there is a wall, return a wall object. These objects are _not_ taken.

say

public final void say(String s)
Say the string.

Overrides:
say in class Bot
Parameters:
s - The string to say.

right

public final void right()
Turn right 90 degrees.

Overrides:
right in class Bot

left

public final void left()
Turn left 90 degrees.

Overrides:
left in class Bot

place

public final void place(Thing t)
                 throws BotException
Place a thing in the square I am standing on.

Overrides:
place in class Bot
Parameters:
t - The object to put down.
Throws:
BotException

restoreStepper

protected void restoreStepper()

restoreTurner

protected void restoreTurner()

restoreGrabber

protected void restoreGrabber()

restoreFeeler

protected void restoreFeeler()

restorePlacer

protected void restorePlacer()

restoreCompass

protected void restoreCompass()

restoreWallFeeler

protected void restoreWallFeeler()

turn

public void turn()

getHeading

public int getHeading()
Maybe return correct heading... if compass is not broken.

Overrides:
getHeading in class Bot
Returns:
current direction (See Heading class for what numbers corrispond to what directions.