function [x, y] = RandomWalk2D(N)
% Simulate a 2D random walk in an (2N+1)-by-(2N+1) grid.
% N is a positive integer.
% Walk starts from the middle and continues until the an edge, abs(N),
% is reached.
% x and y are row vectors with the property that (x(k),y(k)) is the
% location of the token after k hops, k=1:length(x).
% Initializations...
k=0; xc=0; yc=0;
% In general, (xc,yc) is the location after k hops.
while abs(xc)