function [x y] = RandomWalk2D(n)
% n is a positive integer.
% Simulates a 2D random walk that continues until
% the absolute value of the x-coordinate or y-coordinate of the robot
% is equal to n.
% x and y are row vectors with the property that (x(k),y(k)) is the
% location of the robot after k hops, k=1:length(x).
% Initialize the hop counter and current location...
k = 0; xc = 0; yc = 0;
% The random walk...
while abs(xc)