I use the following code from the answers to this post, and this post to insert dice-simulation code in different locations.
How can I put the dice code in a style to be inserted in different locations in the grid!
\documentclass[12pt,a4paper]{article}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\usepackage{tikz-3dplot}
\begin{document}
%begin defining shapes ==========================
\pgfmathsetmacro{\lwdth}{.3mm}% for line width
\tikzset{%
filrd/.style={%
fill=red},
filgr/.style={%
fill=green},
filyw/.style={%
fill=yellow},
filbl/.style={%
fill=blue},
}
%end defining shapes ==========================
%begin defining grid ==========================
\newcommand\sqw{1}
\tikzset{
pics/square/.default={\sqw},
pics/square/.style = {
code = {
\draw[pic actions, draw=none] (0,0) rectangle (#1,#1);
}}}%draw=none is to avoid displaying the little squares outline
\renewcommand\sqw{1.3}
%end defining grid ==========================
\begin{tikzpicture}
\newcommand{\dice}[5]{
\tdplotsetmaincoords{#3}{#4}
\begin{scope}[shift={(#1,#2)}, tdplot_main_coords, rounded corners=#5, fill=brown!30!white]
%bottom face
\begin{scope}[canvas is xy plane at z=-1]
\filldraw[draw=brown!30!white, fill=brown!30!white] (-1,-1) rectangle (1,1);
\end{scope}
%left face
\begin{scope}[canvas is xz plane at y=-1]
\filldraw[draw=brown!30!white, fill=brown!30!white] (-1,-1) rectangle (1,1);
\end{scope}
%back face
\begin{scope}[canvas is yz plane at x=-1]
\filldraw[draw=brown!30!white, fill=brown!30!white] (-1,-1) rectangle (1,1);
\end{scope}
%top face
\begin{scope}[canvas is xy plane at z=1]
\filldraw[draw=brown!30!white, fill=brown!30!white] (-1,-1) rectangle (1,1);
\fill[green!70!black] circle[radius=2/3];
\end{scope}
%right face
\begin{scope}[canvas is xz plane at y=1]
\filldraw[draw=brown!50!white, fill=brown!50!white] (-1,-1) rectangle (1,1);
\fill[blue] circle[radius=2/3];
\end{scope}
%front face
\begin{scope}[canvas is yz plane at x=1]
\filldraw[draw=brown!40!white, fill=brown!40!white] (-1,-1) rectangle (1,1);
\fill[red] circle[radius=2/3];
\end{scope}
\end{scope}
}
\dice{0}{0}{40}{130}{0.3cm};
\end{tikzpicture}
\begin{tikzpicture}[scale=1, transform shape]
\draw[step=\sqw] (\sqw,\sqw) grid (2\sqw, 10\sqw);
\pic[filbl] at (1\sqw,9\sqw) {square};
\node at (1.5\sqw,8.5\sqw) {\Huge insert dice here};
\pic[filgr] at (1\sqw,6\sqw) {square};
\node at (1.5\sqw,5.5\sqw) {\Huge insert dice here};
\pic[filgr] at (1\sqw,4\sqw) {square};
\node at (1.5\sqw,3.5\sqw) {\Huge insert dice here};
\pic[filrd] at (1\sqw,1\sqw) {square};
\end{tikzpicture}
\end{document}

