Rename Assignment 1 to assignments/assignment-1/RandomWalker.java

A drunkard's walk. A drunkard begins walking aimlessly, starting at a lamp post. At each time step, the drunkard forgets where he or she is, and takes one step at random, either north, east, south, or west, with probability 25%. How far will the drunkard be from the lamp post after N steps?

Write a program RandomWalker.java that takes an integer command-line argument N and simulates the motion of a random walker for N steps. After each step, print the location of the random walker, treating the lamp post as the origin (0, 0). Also, print the square of the final distance from the origin.

        % java RandomWalker 10             % java RandomWalker 20
        (0, -1)                           (0, 1)
        (0, 0)                            (-1, 1)
        (0, 1)                            (-1, 2)
        (0, 2)                            (0, 2)
        (-1, 2)                           (1, 2)
        (-2, 2)                           (1, 3)
        (-2, 1)                           (0, 3)
        (-1, 1)                           (-1, 3)
        (-2, 1)                           (-2, 3)
        (-3, 1)                           (-3, 3)
        squared distance = 10             (-3, 2)
                                          (-4, 2)
                                          (-4, 1)
                                          (-3, 1)
                                          (-3, 0)
                                          (-4, 0)
                                          (-4, -1)
                                          (-3, -1)
                                          (-3, -2)
                                          (-3, -3)
                                          squared distance = 18