//
// YOUR JOB IS TO FILL IN THE goToNextTurn COMMAND, SO THAT THE ROBOT
// MOVES FROM ONE END OF THE PIPE TO THE OTHER.
//
// Notice that in main (waaaaay at the bottom), we call FollowThePipe, which in
// turn calls goToNextTurn, 6 times.  We'll need to make sure that goToNextTurn
// can handle one 'leg' of the pipe
//
import becker.robots.*;
import java.util.Random; // to use the "Random" class


class RobotThatFollowsThePipe extends Robot
{
	public RobotThatFollowsThePipe(City c, int st, int ave, Direction dir, int num)
   {
        super(c, st, ave, dir, num);
   }
   
	public void FollowThePipe()
	{
	}
	
	public void turnRight()
	{
	}
}
 
public class ICE_07_If_Else extends Object
{
	// IGNORE THE STUFF BELOW!!!!
	
	// These are a couple of new commands that belong to the program
	// rather than any particular robot.
	// For right now, don't worry about how these work :)
    public static void hallwayN(City c, int st, int ave, int streetsNorth)
    {
        for(int i = 0; i < streetsNorth; i++)
        {
            new Wall(c, st - i, ave, Direction.WEST);
            new Wall(c, st - i, ave, Direction.EAST);
        }
    }

	public static void hallwayE(City c, int st, int ave, int streetsEast)
    {
        for(int i = 0; i < streetsEast; i++)
        {
            new Wall(c, st, ave+i, Direction.NORTH);
            new Wall(c, st, ave+i, Direction.SOUTH);
        }
    }

    public static void setupCity(City c)
    {
		hallwayE(c, 4, 2, 3);
		new Wall(c, 4, 1, Direction.NORTH);
		new Wall(c, 4, 1, Direction.WEST);
		new Wall(c, 4, 1, Direction.SOUTH);

		hallwayN(c, 3, 5, 3);
		new Wall(c, 4, 5, Direction.EAST);
		new Wall(c, 4, 5, Direction.SOUTH);
		new Thing(c, 4, 5);
		
		hallwayE(c, 0, 6, 3);
		new Wall(c, 0, 5, Direction.NORTH);
		new Wall(c, 0, 5, Direction.WEST);

		hallwayN(c, 3, 9, 3);
		new Wall(c, 0, 9, Direction.EAST);
		new Wall(c, 0, 9, Direction.NORTH);
		
		hallwayE(c, 4, 10, 8);		
		new Wall(c, 4, 9, Direction.WEST);
		new Wall(c, 4, 9, Direction.SOUTH);
		new Thing(c, 4, 9);

		new Wall(c, 4, 17, Direction.NORTH);
		new Wall(c, 4, 17, Direction.EAST);
		new Wall(c, 4, 17, Direction.SOUTH);
    }

	// IGNORE THE STUFF ABOVE !!!!

   public static void main(String[] args)
   { 
      City toronto = new City(6, 20);
      RobotThatFollowsThePipe Jo = new RobotThatFollowsThePipe(toronto, 4, 1, Direction.EAST, 0);
      setupCity(toronto); // ignore this line for now

		// Move Jo to the far end of hte pipe.
		
		// You must use at least:
		// 	1.	One new type of Robot
		//	2.	The new type of robot must have at least two new commands, and you must use both
		//	3.	You must use an if (or an if/else) statement somewhere
		//	4.	You must use a counting loop
		//	5.	You must use a non-counting loop (for example – while( Jo.frontIsClear() { } )
   } 
}


