public class HeadlessSuperKarel extends HeadlessKarel
Modifier and Type | Field and Description |
---|---|
static Color |
BLACK |
static Color |
BLUE |
static Color |
CYAN |
static Color |
DARK_GRAY |
static Color |
GRAY |
static Color |
GREEN |
static Color |
LIGHT_GRAY |
static Color |
MAGENTA |
static Color |
ORANGE |
static Color |
PINK |
static Color |
RED |
static Color |
WHITE |
static Color |
YELLOW |
CENTER
Constructor and Description |
---|
HeadlessSuperKarel() |
Modifier and Type | Method and Description |
---|---|
boolean |
beepersInBag() |
boolean |
beepersPresent() |
protected void |
checkWorld(String caller) |
boolean |
cornerColorIs(Color color) |
boolean |
cornerColorIs(double red,
double blue,
double green) |
boolean |
cornerColorIs(int rgb) |
boolean |
facingEast() |
boolean |
facingNorth() |
boolean |
facingSouth() |
boolean |
facingWest() |
boolean |
frontIsBlocked() |
boolean |
frontIsClear() |
int |
getBeepersInBag() |
int |
getDirection() |
Point |
getLocation() |
KarelWorld |
getWorld() |
boolean |
leftIsBlocked() |
boolean |
leftIsClear() |
static void |
main(String[] args) |
Color |
newColor(int rgb) |
boolean |
noBeepersInBag() |
boolean |
noBeepersPresent() |
boolean |
notFacingEast() |
boolean |
notFacingNorth() |
boolean |
notFacingSouth() |
boolean |
notFacingWest() |
void |
paintCorner(Color color) |
void |
paintCorner(double red,
double blue,
double green) |
void |
paintCorner(int rgb) |
void |
pause(double milliseconds) |
void |
pickBeeper() |
void |
putBeeper() |
boolean |
random() |
boolean |
random(double p) |
boolean |
rightIsBlocked() |
boolean |
rightIsClear() |
void |
run() |
void |
say(String text)
Causes Karel to pop up a speech bubble with the given text in it.
|
void |
setBeepersInBag(int nBeepers) |
void |
setDirection(int dir) |
void |
setDisplayOneFlag(boolean flag) |
void |
setLocation(int x,
int y) |
void |
setLocation(Point pt) |
void |
setParameterTable(Map<String,String> table) |
void |
setStartupObject(Object obj) |
void |
setWorld(KarelWorld world) |
void |
start(String[] args)
Starts a
KarelProgram containing this Karel instance,
passing it the specified arguments. |
void |
turnAround() |
void |
turnLeft() |
void |
turnRight() |
exit, getLocationsVisited, getSaveFile, getTitle, getWorldFile, hasVisited, hasVisited, init, move, print, print, printf, println, println, println, setExitEnabled, setSaveFile, setTitle, setTrackLocationsVisited, setWorldFile, start
public static final Color BLACK
public static final Color BLUE
public static final Color CYAN
public static final Color DARK_GRAY
public static final Color GRAY
public static final Color GREEN
public static final Color LIGHT_GRAY
public static final Color MAGENTA
public static final Color ORANGE
public static final Color PINK
public static final Color RED
public static final Color WHITE
public static final Color YELLOW
public void run()
run
in interface ProgramInterface
run
in interface Runnable
run
in interface KarelInterface
run
in class HeadlessKarel
public void turnRight()
public void turnAround()
public void paintCorner(Color color)
public void paintCorner(int rgb)
public void paintCorner(double red, double blue, double green)
public Color newColor(int rgb)
public boolean random()
public boolean random(double p)
public boolean cornerColorIs(Color color)
public boolean cornerColorIs(int rgb)
public boolean cornerColorIs(double red, double blue, double green)
public void pause(double milliseconds)
pause
in interface ProgramInterface
pause
in interface KarelInterface
public void say(String text)
public void turnLeft()
turnLeft
in interface KarelInterface
public void pickBeeper()
pickBeeper
in interface KarelInterface
public void putBeeper()
putBeeper
in interface KarelInterface
public boolean frontIsClear()
frontIsClear
in interface KarelInterface
public boolean frontIsBlocked()
frontIsBlocked
in interface KarelInterface
public boolean leftIsClear()
leftIsClear
in interface KarelInterface
public boolean leftIsBlocked()
leftIsBlocked
in interface KarelInterface
public boolean rightIsClear()
rightIsClear
in interface KarelInterface
public boolean rightIsBlocked()
rightIsBlocked
in interface KarelInterface
public boolean beepersPresent()
beepersPresent
in interface KarelInterface
public boolean noBeepersPresent()
noBeepersPresent
in interface KarelInterface
public boolean beepersInBag()
beepersInBag
in interface KarelInterface
public boolean noBeepersInBag()
noBeepersInBag
in interface KarelInterface
public boolean facingNorth()
facingNorth
in interface KarelInterface
public boolean facingEast()
facingEast
in interface KarelInterface
public boolean facingSouth()
facingSouth
in interface KarelInterface
public boolean facingWest()
facingWest
in interface KarelInterface
public boolean notFacingNorth()
notFacingNorth
in interface KarelInterface
public boolean notFacingEast()
notFacingEast
in interface KarelInterface
public boolean notFacingSouth()
notFacingSouth
in interface KarelInterface
public boolean notFacingWest()
notFacingWest
in interface KarelInterface
public static void main(String[] args)
public void setParameterTable(Map<String,String> table)
setParameterTable
in interface ProgramInterface
public void setStartupObject(Object obj)
setStartupObject
in interface ProgramInterface
public void start(String[] args)
KarelProgram
containing this Karel instance,
passing it the specified arguments.start
in interface ProgramInterface
public Point getLocation()
getLocation
in interface KarelInterface
public void setLocation(Point pt)
setLocation
in interface KarelInterface
public void setLocation(int x, int y)
setLocation
in interface KarelInterface
public int getDirection()
getDirection
in interface KarelInterface
public void setDirection(int dir)
setDirection
in interface KarelInterface
public int getBeepersInBag()
getBeepersInBag
in interface KarelInterface
public void setBeepersInBag(int nBeepers)
setBeepersInBag
in interface KarelInterface
public KarelWorld getWorld()
getWorld
in interface KarelInterface
public void setWorld(KarelWorld world)
setWorld
in interface KarelInterface
protected void checkWorld(String caller)
public void setDisplayOneFlag(boolean flag)