Help:=proc(): print(`WalkPlot(L) will plot the 2d walk L, given as a list of steps.`): print(`Optionally you can include a set T as the second argument, whose`): print(`points are plotted as red circles (perhaps they are points to avoid?).`): print(`All walks start from the origin.`): print(`The start and end points are marked with a diamond.`): print(`WalkPlot3d(L) will plot the 3d walk L, given as a list of steps.`): end: #WalkPlot plots walk L given as a sequence of steps. You can optionally have a second argument being the set of points to avoid. #e.g. WalkPlot([[1,0],[0,1],[-1,0],[0,-1]]) will plot a square WalkPlot:=proc(L) local stops: stops:=ListTools[PartialSums]([[0,0],op(L)]): if nargs=2 then return plots[display]({plots[pointplot](stops, connect=true, symbol=cross, symbolsize=20), plots[pointplot]({[0,0],stops[nops(stops)]},symbol=diamond,symbolsize=16), plots[pointplot](args[2],symbol=circle, symbolsize=20,color=red)},axes=boxed,gridlines=true, scaling=constrained): else return plots[display]({plots[pointplot](stops, connect=true, symbol=cross, symbolsize=20), plots[pointplot]({[0,0],stops[nops(stops)]},symbol=diamond,symbolsize=16)}, axes=boxed, gridlines=true, scaling=constrained): fi: end: #WalkPlot3d plots 3d walk L given as a sequence of 3d steps. You can optionally have a second argument being the set of points to avoid. WalkPlot3d:=proc(L) local stops: stops:=ListTools[PartialSums]([[0,0,0],op(L)]): if nargs=2 then return plots[display]({plots[pointplot3d](stops, connect=true, symbol=cross, symbolsize=20), plots[pointplot3d]({[0,0,0],stops[nops(stops)]},symbol=diamond,symbolsize=15), plots[pointplot3d](args[2],symbol=circle, symbolsize=20,color=red)},axes=boxed, scaling=constrained): else return plots[display]({plots[pointplot3d](stops, connect=true, symbol=cross, symbolsize=20), plots[pointplot3d]({[0,0,0],stops[nops(stops)]},symbol=diamond,symbolsize=15)}, axes=boxed, scaling=constrained): fi: end: