summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex34
1 files changed, 15 insertions, 19 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex b/Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex
index 6c9871a5f59..feff93d0956 100644
--- a/Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex
+++ b/Master/texmf-dist/doc/generic/pstricks/voss/bsp55.tex
@@ -10,35 +10,31 @@
% Random walk in the unit square (#1 = number of steps)
\def\RandomWalk#1{%
-\setrandim\dX{0pt}{1pt}
-\setrandim\dY{0pt}{1pt}
-\psdot[dotstyle=*,dotsize=6pt](\pointless\dX,\pointless\dY) % Initial point
-\pscustom{%
- \moveto(\pointless\dX,\pointless\dY) % Move to initial point
- \multido{\i=1+1}{#1}{%
- \MoveCoordinate{\dX}
- \MoveCoordinate{\dY}
- \lineto(\pointless\dX,\pointless\dY)}}} % Line between old and new position
+ \setrandim\dX{0pt}{1pt}
+ \setrandim\dY{0pt}{1pt}
+ \psdot[dotstyle=*,dotsize=6pt](\pointless\dX,\pointless\dY) % Initial point
+ \pscustom{%
+ \moveto(\pointless\dX,\pointless\dY) % Move to initial point
+ \multido{\i=1+1}{#1}{%
+ \MoveCoordinate{\dX}
+ \MoveCoordinate{\dY}
+ \lineto(\pointless\dX,\pointless\dY)}}} % Line between old and new position
% Computation of new horizontal or vertical position of point
\def\MoveCoordinate#1{%
-\setrandim\Coor{-0.06pt}{0.06pt} % The move
-\advance #1 by \Coor % New position
+ \setrandim\Coor{-0.06pt}{0.06pt} % The move
+ \advance #1 by \Coor % New position
% To stay in the square...
-\ifdim#1>1pt
- #1=1pt
-\fi
-\ifdim#1<0pt
- #1=0pt
-\fi}
+ \ifdim#1>1pt #1=1pt\fi
+ \ifdim#1<0pt #1=0pt\fi}
\pagestyle{empty}
\parindent=0pt
\begin{document}
-\psset{unit=11,dimen=middle}
-\begin{pspicture}(1,1)
+\psset{unit=7,dimen=middle,linewidth=0.5pt}
+\begin{pspicture}(1,1.01)
\psframe[linewidth=0.1pt](1,1)
\RandomWalk{300}
\psset{linecolor=red}