Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{tikz}
  3.  
  4. newcommand{NEpath}[4]{
  5. fill[white!25] (#1) rectangle +(#2,#3);
  6. fill[fill=white]
  7. (#1)
  8. foreach dir in {#4}{
  9. ifnumdir=0
  10. -- ++(1,0)
  11. else
  12. -- ++(0,1)
  13. fi
  14. } |- (#1);
  15. draw[help lines] (#1) grid +(#2,#3);
  16. draw[dashed] (#1) -- +(#3,#3);
  17. coordinate (prev) at (#1);
  18. foreach dir in {#4}{
  19. ifnumdir=0
  20. coordinate (dep) at (1,0);
  21. else
  22. coordinate (dep) at (0,1);
  23. fi
  24. draw[line width=2pt,-stealth] (prev) -- ++(dep) coordinate (prev);
  25. };
  26. }
  27.  
  28. begin{document}
  29. begin{tikzpicture}
  30. NEpath{0,0}{6}{6}{1,1,0,1,1,0,0,0,1,0,1,0};
  31. end{tikzpicture}
  32. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement