m = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1,
1}, {1, 1}, {1, 1}};
m2 = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1,
1}, {1, 1}, {1, 1}};
Manipulate[
Do[
m[[n]] = m[[n]] + RandomChoice[{{0, 1}, {1, 0}, {0, -1}, {-1, 0}, {0, 0}}];
, {n, 10}];
Do[
m2[[n]] = m2[[n]] + RandomChoice[{{0, 1}, {1, 0}, {0, -1}, {-1, 0}, {0, 0}}];
, {n, 10}];
Show[ListPlot[m, PlotStyle -> Red]
, ListPlot[m2, PlotStyle -> {PointSize[0.03]}]]
, {n, 1, 20}]
This is pseudo-randomwalk. I want to plot in only square (0,0),(100,0),(0,100),(100,100). Please teach me the random walk in limited range.

nxt:nxt = pt + RandomChoice[{{0, 1}, {1, 0}, {0, -1}, {-1, 0}, {0, 0}}]– J. M.'s missing motivation Apr 04 '16 at 07:57{50,50}rather than{0,0}– Jason B. Apr 04 '16 at 08:00