7

I'm trying to setup an animated counter with PSTricks predefined digits. Got it to work up to 18 frames. However when increasing the number of frames, I can't handle it clever enough. No problem for the experts I guess ...

I setup an array of PSTricks based drawn digits with the xint package and moved the 10 drawn digits into the array: \digits

\digits{1} gives the drawn digit "0" \digits{2} gives the drawn digit "1" ... \digts{10} gives the drawn digit "9"

Whereas \digits{0} gives the number of elements within the defined array ...

Now within the \multiframe command I tried to cleverly let the digits come along and brought it up to 18 frames and then my ideas to make that better got lost ...

Here the code:

% arara: latex
% arara: latex
% arara: dvisvgm : {options: ['exact', 'font-format=woff', 'zoom=-1']}
\documentclass[%
%dvisvgm,
]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr}
\pagestyle{empty}

\begin{document}
\definecolor{digits}{rgb}{0,0,0}  % BLACK
%\definecolor{digits}{HTML}{FF7F00} % ORANGE
%\definecolor{digits}{rgb}{0.79,0.255,0.329} % BRICKRED

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

%% Bringing the digits into an array with 10 elements: 1, 2, 3, 4, ..., 9, 0
%% \digits{1} = spies out the digit 0, \digits{9} = spies aout digit 8, \digits{10} = spies out digit 9, 
%% \digits{0} = spies out the number of elements = 10
\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 1
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
}\to\digits

\begin{center}
\begin{animateinline}[%
    controls,
    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
%% Works up to 18 frames then the modulo 10 sets second digit to zero which means it takes the number of the
%% above defined array -- which outputs the number of elements within the array and not the wanted digit ... EUF!!! 
\multiframe{18}{iA=1+1}{%
\xintifbooliiexpr{\iA<10}%
{\rput(0,0){\pstilt{85}{\digits{\iA+1}}}}%
{\rput(0,0){\pstilt{85}{\digits{2}}}\rput(1.75,0){\pstilt{85}{\digits{\xinttheiiexpr (\iA+1)/:10\relax}}}}
}
\end{animateinline}
\end{center}
\end{document}

Here the animation so far:

enter image description here

Any help appreciated!

  • 1
    don't you want in place of \xinttheiiexpr (\iA+1)/:10\relax something like 1 + \xintheiiexpr \iA /: 10\relax, so when \iA reaches 10 we get \digits{1}=0 etc... and much simpler (\digits parses via \numexpr): \digits{11 + \iA - 10*((\iA + 5)/10)} ...then you don't need xintexpr, but only xinttools to define \digits via \xintAssignArray. – user4686 Jan 15 at 22:49
8

What do you think about that?

\documentclass[%
]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0,0}  % BLACK
%\definecolor{digits}{HTML}{FF7F00} % ORANGE
%\definecolor{digits}{rgb}{0.79,0.255,0.329} % BRICKRED

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

%% Bringing the digits into an array with 10 elements: 1, 2, 3, 4, ..., 9, 0
%% \digits{1} = spies out the digit 0, \digits{9} = spies aout digit 8, \digits{10} = spies out digit 9,
%% \digits{0} = spies out the number of elements = 10
\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 1
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
}\to\digits

\begin{center}
\begin{animateinline}[%
    controls,
    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
%% Works up to 18 frames then the modulo 10 sets second digit to zero which means it takes the number of the
%% above defined array -- which outputs the number of elements within the array and not the wanted digit ... EUF!!!
\multiframe{131}{iA=0+1}{%
%\xintifbooliiexpr{\iA<10}%
%{\rput(0,0){\pstilt{85}{\digits{\iA+1}}}}%
%    {%
    \rput(-1.75,0){\pstilt{85}{\digits{\xinttheexpr (1+floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digits{\xinttheexpr (1+floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digits{\xinttheiiexpr 1+(\iA/:10)\relax}}}%
%    }%
}
\end{animateinline}
\end{center}
\end{document} 

Second variant:

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0,0}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}

\def\digitI{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{61}{iA=60+-1}{%
\xintifbooliiexpr{\iA=0}%
{\rput(0,0){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
    {%
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
    }%
}
\end{animateinline}
\end{center}
\end{document}

A variation

click to see in action

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % BLACK
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.3}%linestyle=none,

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitI{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-4,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{61}{iA=60+-1}{%
\psframe*(-4,-1)(5,3)
\xintifbooliiexpr{\iA=0}%
{\rput(0.5,1){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
    {%
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
    }%
}
\end{animateinline}
\end{center}
\end{document} 

Now it's time for 24 hours

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % green
\definecolor{warning}{HTML}{FF7F00}   % orange
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % dark gray

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.95}%linestyle=none,

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitI{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-9,-1)(5,3)\psframe*(-9,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{30}{iA=86370+1}{%
    \rput(-7.0,0){\pstilt{85}{\digitJG{\xinttheiiexpr ((\iA//3600)/:24)//10\relax}}}
    \rput(-5.25,0){\pstilt{85}{\digitJG{\xinttheiiexpr ((\iA//3600)/:24)/:10\relax}}}
    \xintifbooliiexpr{\iA/:2=0}{\rput(-3.65,1){\pstilt{85}{\Huge \color{gray!30} :}}}{}%      colon every second frame
    \rput(-3.5,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//600)/:6\relax}}}
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//60)/:10\relax}}}
    \xintifbooliiexpr{\iA/:2=0}{\rput(-0.15,1){\pstilt{85}{\Huge \color{gray!30} :}}}{}%      colon every second frame
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//10)/:6\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
}
\newframe
\rput(-2,1){\pstilt{85}{\textcolor{warning}{\textsf{\bfseries\Huge Only 24 hours!}}}}%
\end{animateinline}
\end{center}
\end{document}

enter image description here

  • 1
    @Thomas I made an animated SVG of it. I took the liberty to turn your PNG into a link to it. Feel free to undo this if you disagree. – AlexG Jan 16 at 14:32
  • 1
    @Thomas for info floor(\iA/100) is same as \iA//100 (double slash division operator, like in Python3; whereas single slash / in \xintexpr is of course exact division as xintexpr manipulates exact fraction, and in \xintiiexpr which manipulates only integers / is rounded division like in \numexpr, and // is again floored division). – user4686 Jan 17 at 9:40
  • 1
    @Thomas : You don't need \xintifbooliiexpr. Put \psframe*(-4,-1)(5,3)+the "READY"-thing after the \mutliframe-block, separating it with a \newframe to make it the last frame. See Jfbu's answer, which I edited accordingly. – AlexG Jan 17 at 11:46
  • 1
    @AlexG the psframe should be behind the picture, so I put it to begin={... The READY-thing is now after a \newframe. animate is a nice package, thanks. – user139826 Jan 17 at 13:39
  • 1
    Yes, good idea to put it there, as it is shared by all frames. – AlexG Jan 17 at 13:41
1

A variant of @Thomas answer, dropping all usages of xintexpr, only xinttools needed.

For reasons I don't know, with the count-down start set at 118 in place of 117, there is TeX capacity exceeded error. This is not related to xint...

% avec shell-escape

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xinttools}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % BLACK
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.3}%linestyle=none,

\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 1
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}}\to\JGDIGITS

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-4,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
  \multiframe{117}{iA=117+-1}{% but "TeX capacity exceeded" with 118 :((
    \psframe*(-4,-1)(5,3)
    \xintDigitsOf\the\numexpr 1000+\iA\relax\to\JGdigits  % 4 digits, first=1
    \rput(-1.75,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{2}}}}%  hundreds
    \rput(0,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{3}}}}%      decades
    \rput(1.75,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{4}}}}%   units
  }%
  \newframe
  \psframe*(-4,-1)(5,3)%
  \rput(0.5,1){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}
\end{animateinline}
\end{center}
\end{document}
  • 1
    (my "READY!" overprints the 001 at end, feel free to correct my code, I don't know PSTricks) but main worry is why does it not work with 118 + 1 frames ? – user4686 Jan 17 at 10:24
  • 1
    Within the actual documentation the animate package page 27 we read: Animations with complex graphics and/or many frames may cause LaTeX to fail with a ‘TeX capacity exceeded’ error. The following steps should fix most of the memory related problems. There is a way described how to increase TeX memory for either MiKTeX or TeX Live. I cannot reproduce that behaviour, cause I already increased TeX memory. – user151328 Jan 17 at 10:36
  • 1
    The simplest way, without rebuilding formats, is to use luatex in order to get around memory issues: lualatex --output-format=dvi input.tex. – AlexG Jan 17 at 10:54
  • 1
    You must insert \newframe between the \multiframe block and the "READY"-thing. – AlexG Jan 17 at 11:10
  • 1
    @AlexG, ah ok got it. – user4686 Jan 17 at 13:12
1

A slightly shorter version from Thomas' solution:

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}
\makeatletter\let\Digit\@nameuse\makeatother    
\definecolor{digits}{rgb}{0,0,0}  % BLACK   
\psset{linewidth=0.5pt,linecolor=digits}

\begin{document}
\def\BL{\pspolygon*(0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)}
\def\TL{\pspolygon*(0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)}
\def\BR{\pspolygon*(1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)}
\def\TR{\pspolygon*(1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)}
\def\B{\pspolygon*(0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)}
\def\T{\pspolygon*(0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)}
\def\M{\pspolygon*(0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)}

\def\0{\BL\TL\BR\TR\B\T}    \def\1{\BR\TR}
\def\2{\BL\TR\B\T\M}        \def\3{\BR\TR\B\T\M}
\def\4{\TL\BR\TR\M}         \def\5{\TL\BR\B\T\M}
\def\6{\BL\TL\BR\B\M}       \def\7{\BR\TR\T}
\def\8{\BL\TL\BR\TR\B\T\M}  \def\9{\TL\BR\TR\B\T\M}

\begin{center}
\begin{animateinline}[controls,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}]{2}% frame rate = 2 image/s
  \multiframe{61}{iA=60+-1}{%
    \xintifbooliiexpr{\iA=0}%
        {\rput(0,0){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
            {\rput(-1.75,0){\pstilt{85}{\Digit{\xinttheexpr 
                (floor(\iA/100))/:10\relax}}}
                \rput(0,0){\pstilt{85}{\Digit{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
                \rput(1.75,0){\pstilt{85}{\Digit{\xinttheiiexpr (\iA/:10)\relax}}}%
            }%
  }
\end{animateinline}
\end{center}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy