I am sort of having two main issues with Dyck paths. I'm trying to get to the image on the left (which I edited it with Paint), and what I currently have is the image on the right. I believe that what I need to do, is have these Dyck paths behave as nodes in order to be able to connect them with an edge, but what I have tried thus far has not led me to this. I am clueless as to how may I have the numbers on the bottom printed as well. I've thought about these numbers as nodes also, but I personally believe that maybe it will be complicating things a bit too much.
I hope I have made myself clear.
Thank you for any help I can get.
This is the code I currently have:
\documentclass{article}
\usepackage{tikz}
\usepackage{pdflscape}
\newcommand\dyckpath[3]{
\fill[white] (#1) rectangle +(#2,#2);
\fill[fill=white]
(#1)
\foreach \dir in {#3}{
\ifnum\dir=0
-- ++(1,0)
\else
-- ++(0,1)
\fi
} |- (#1);
\draw[help lines] (#1) grid +(#2,#2);
\coordinate (prev) at (#1);
\foreach \dir in {#3}{
\ifnum\dir=0
\coordinate (dep) at (1,0);
\else
\coordinate (dep) at (0,1);
\fi
\draw[line width=2pt] (prev) -- ++(dep) coordinate (prev);
};
}
\begin{document}
\thispagestyle{empty}
\begin{landscape}
\centering
\begin{tikzpicture}[scale=0.7]
\dyckpath{0,0}{3}{1,1,1,0,0,0};
\dyckpath{0,-5}{2}{1,1,0,0};
\end{tikzpicture}
\end{landscape}
\end{document}





