I am trying to create a 2 dimensional random walk that has an equal chance to do up, down, right, or left with a do loop and which statement, but I am not sure I have the correct coding.
M = Table[0, {1000}, {2}];
Do[x = RandomReal[];
Which[0 <= x <= 0.25, y = 1,
0.25 <= x <= 0.50, y = -1,
0.50 <= x <= 0.75, y = 1,
0.75 <= x <= 1.0, y = -1];
M[[i + 1, j]] = y + M[[i, j]],
{i, -999, 999}, {j, -1, 2}];
Grid[M]