I need to develop:

  (a) Drunkard.java

  (b) GuessTheNumber.java

Christian Kayl Levi R Seth Jiebo Jerry Jared Alex S Vanessa Mike C He He Andrew T 
Arif Jiahao Keqin Max (Yinan) Arthi Joe B Sunhyun Xing Alex Q Rerajitha M Kevin S 
David Jaehak Lee Brandon P Andy Ray Zhiwei Siddartha Rajeev Chenrui Haoyang Danny 

public class Drunkard {
  private int x, y; 
  public Drunkard() { // places the Drunkard in the origin
    this(0, 0); // just another way to place the Drunkard in the origin
  }
  public Drunkard(int x, int y) {
    super(); 
    this.x = x; 
    this.y = y; 
  } 
  public void move() {
    int direction = (int) (Math.random() * 4); // 0, 1, 2, 3
    if (direction == 0) { // go north (up) 
      this.y -= 1; 
    } else if (direction == 1) { // go east (right) 
      this.x += 1; 
    } else if (direction == 2) { // go south (down)
      this.y += 1; 
    } else if (direction == 3) { // go west (right) 
      this.x -= 1; 
    } else {
      System.out.println( "Whoa, can't be!" ); 
      // can we do something more spectacular here
    }
  }   
  public String toString() {
    return "Hiccup: (" + this.x + ", " + this.y + ")"; 
  }
  public static void main(String[] args) {
    Drunkard a = new Drunkard(4, 5); 
    for (int i = 0; i < 100; i++) {
      a.move(); 
      System.out.println( a ); 
    } 
  }
}

Next we wrote this program to demonstrate command

import java.util.Scanner; 

public class GuessTheNumber {
  public static void main(String[] args) {
    String debug = args.length == 0 ? "" : args[0];  // [1] 
    int secret = (int) (Math.random() * 100) + 1;
    int mistakes = 0; 
    Scanner s = new Scanner(System.in); 
    if (debug.equals("debug"))                       // [2] 
      System.out.print("(" + secret + ") Type: "); 
    else
      System.out.print("Type: "); 
    String line = s.nextLine(); 
    while (! line.equals("bye")) {
      int number = Integer.parseInt(line); 
      if (number > secret) {
        mistakes += 1;
        if (mistakes < 6) 
          System.out.println("Try lower."); 
        else {
          System.out.println("You lost."); 
          break; 
        }
      } else if (number < secret) {
        mistakes += 1;
        if (mistakes < 6) 
          System.out.println("Try higher."); 
        else {
          System.out.println("You lost."); 
          break; 
        }
      } else {
        System.out.println("You won."); 
        break;   
      }
      if (debug.equals("debug"))                          // [3] 
        System.out.print("(" + secret + ") Type: "); 
      else
        System.out.print("Type: "); 
      line = s.nextLine(); 
    }    
  }
}

So this was perfect and it can still be improved. 

See you in lab. 

--