/**
 * A Robot that is capable of displaying the message "Hello"
 * 
 * @author Russell C. Bjork
 * @version January 9, 2006
 */
import kareltherobot.*;

public class HelloDisplayerRobot extends Robot
{
    /** Constructor
     *
     *  @param street the starting street for this robot
     *  @param avenue the starting avenue for this robot
     *  @param direction the direction this robot is initially facing
     *  @param beepers the number of beepers this robot has initially
     */
    public HelloDisplayerRobot(int street, int avenue, Direction direction, int beepers)
    {
        super(street, avenue, direction, beepers);
    }
    
    /** Display the message "HELLO" in beepers
     */
    public void displayHello()
    {
        drawH();
        drawE();
        drawL();
        drawL();
        drawO();
    }
    
    /** Draw the letter "H" in beepers
     */
    public void drawH()
    {
        bar5();
        turnAround();
        move2();
        turnLeft();
        move();
        bar2();
        move();
        turnLeft();
        move2();
        turnAround();
        bar5();
        turnLeft();
        move2();
        turnLeft();
    }
      
    /** Draw the letter "E" in beepers
     */
    public void drawE()
    {
        bar5();
        turnRight();
        move();
        bar2();
        turnRight();
        move2();
        turnRight();
        bar2();
        turnLeft();
        move2();
        turnLeft();
        bar2();
        move2();
        turnLeft();
    }
      
    /** Draw the letter "L" in beepers
     */
    public void drawL()
    {
        bar5();
        turnAround();
        move2();
        move2();
        turnLeft();
        move();
        bar2();
        move2();
        turnLeft();
    }

    /** Draw the letter "O" in beepers
     */
    public void drawO()
    {
        bar5();
        turnRight();
        move();
        bar2();
        move();
        turnRight();
        bar5();
        turnRight();
        move();
        bar2();
        turnAround();
        move2();
        move2();
        turnLeft();
    }

    /** Draw a bar consisting of five beepers
     */
    public void bar5()
    {
        putBeeper();
        move();
        putBeeper();
        move();
        putBeeper();
        move();
        putBeeper();
        move();
        putBeeper();
    }
    
    /** Draw a bar consisting of two beepers
     */
    public void bar2()
    {
        putBeeper();
        move();
        putBeeper();
    }
    
    /** Move two squares
     */
    public void move2()
    {
        move();
        move();
    }
    
    /** Turn 90 degrees right
     */
    public void turnRight()
    {
        turnLeft();
        turnLeft();
        turnLeft();
    }
    
    /** Turn around
     */
    public void turnAround()
    {
        turnLeft();
        turnLeft();
    }
}