The picture below is what I am trying to create.
I have asked a similar question before, and I got an excellent answer, but it's still not 100% what I am looking for. I know that I have to use \usepackage{tikz}
and possibly \usepackage{xintexpr} and \usetikzlibrary{math}
\documentclass[tikz,border=5]{article}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}[x=2cm,y=-2cm, node 0/.style={fill=red!20}]
\tikzmath{%
int \i, \j, \m, \n, \t;
\m = 5; \n = 5;
% Initialise board.
for \i in {0,...,\m}{
for \j in {0,...,\n}{
\t{\i,\j} = 0;
};
};
% Create holes.
\t{2,3} = -1;
\t{3,4} = -1;
\t{5,2} = -1;
% Perform calculations.
for \i1 in {0,...,\m}{
for \j1 in {0,...,\n}{
if (\t{\i1,\j1} == -1) then {
\t{\i1,\j1} = 0;
} else {
if (\i1 == 0 || \j1 == 0) then {
\t{\i1,\j1} = 1;
} else {
\i2 = \i1 - 1;
\j2 = \j1 - 1;
\t{\i1,\j1} = \t{\i2,\j1} + \t{\i1,\j2};
};
};
};
};
% Draw nodes.
for \i1 in {0,...,\m}{
for \j1 in {0,...,\n}{
{ \node [circle, fill=blue!20, minimum size=1cm, node \t{\i1,\j1}/.try]
(n-\i1-\j1) at (\j1, \i1) {\t{\i1,\j1}}; };
};
};
% Draw edges.
for \i1 in {0,...,\m}{
for \j1 in {0,...,\n}{
\i2 = \i1 + 1;
\j2 = \j1 + 1;
if (\i1 < \m) then {
if (\t{\i2,\j1} > 0) then {
{ \draw [thick, -stealth] (n-\i1-\j1) -- (n-\i2-\j1); };
};
};
if (\j1 < \n) then {
if (\t{\i1,\j2} > 0) then {
{ \draw [thick, -stealth] (n-\i1-\j1) -- (n-\i1-\j2); };
};
};
};
};
}
\end{tikzpicture}
\end{document}
This code has the idea to what I am looking for, but what I want is to refine the code so it can look exactly like the picture included. I'm new to latex and the idea of programming/coding, but I am trying to learn.
Also my picture needs to fit into my homework problem setting
\documentclass[28pt]{article}
\usepackage{fancyhdr}
\usepackage[includeheadfoot,margin=1.0cm]{geometry}