Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{tikz}
- newcommand{NEpath}[4]{
- fill[white!25] (#1) rectangle +(#2,#3);
- fill[fill=white]
- (#1)
- foreach dir in {#4}{
- ifnumdir=0
- -- ++(1,0)
- else
- -- ++(0,1)
- fi
- } |- (#1);
- draw[help lines] (#1) grid +(#2,#3);
- draw[dashed] (#1) -- +(#3,#3);
- coordinate (prev) at (#1);
- foreach dir in {#4}{
- ifnumdir=0
- coordinate (dep) at (1,0);
- else
- coordinate (dep) at (0,1);
- fi
- draw[line width=2pt,-stealth] (prev) -- ++(dep) coordinate (prev);
- };
- }
- begin{document}
- begin{tikzpicture}
- NEpath{0,0}{6}{6}{1,1,0,1,1,0,0,0,1,0,1,0};
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement