import becker.robots.*;
import java.util.*;

public class Basic_Keyboard_IO extends Object
{
    public static void main(String[] args)
    {
        	System.out.println ("THE PROGRAM STARTS HERE!!");

		  	int numMoves = 0; // Since the loop below stops when numMoves == -1,
								   // it is important that this be anything EXCEPT -1
									// Setting numMoves to zero works just fine
			int counter = 0;
			Scanner keyboard = new Scanner(System.in);   

        	City seattle = new City();
        	Robot mary = new Robot(seattle, 1, 1, Direction.EAST, 0);
    
        	System.out.println ("How many intersections forward would you like the robot to go?");
			if( keyboard.hasNextInt() )
			{
				numMoves = keyboard.nextInt();   // nextInt actually gets the input
         	System.out.println ("You asked to move " + numMoves + " spaces");
				counter = 0;
				while( counter < numMoves)
				{
					mary.move();
					counter = counter + 1;
				}
			}
			else
			{
   	     	System.out.println ("You did NOT type in a whole number!");
			}
			
			keyboard.nextLine(); // DON'T FORGET TO CLEAR ANY REMAINING INPUT!!
				
        	System.out.println ("THE PROGRAM ENDS HERE!!");
    }
}
