# Counting rods; count your rods

## Python 2 - 216

My first shot, might be some stuff to take out, but my brain hurts, so it's good enough for now

x=raw_input()
for l in range(5):print'  '.join((' '*7+'|   | |  ||| || '+'|'*7+'__|'+'_'*7)[[7*(4-l<n%6+n/6)+(n>5)*(l<10-n)-(l==10-n),n%6+n/6+(l<1)*(n>5)*(12-n)][(len(x)-i)%2]*5:][:5]for i,n in enumerate(map(int,x)))


## JavaScript (ES6) 223

Function with numeric parameter, output to console. NB If the input parameter could be a string, the code would be 5 char shorter and without the limit of 17 significative digits of JS numbers.

F=n=>{
for(r=s='',n+=s;r<5;r++,s+=q)
for(f=q='\n',p=n.length;f=!f,p--;q=(p?'  ':'')+'     1  |  1 | | 1 ||| 1|| ||1|||||1_____1__|__'.split(1)[d]+q)
if(d=~~n[p])e=d+r,d=d>5?f?e<10?1:e>10?6:7:r?d-5:6:f?e>4?6:0:d;
console.log(s)
}


Test

Test in Firefox console.

F(12)

Output

        | |
| |
| |
| |
_____   | |


F(8037)

Output

  |                  _____
|                   | |
__|__         _____   | |
_____         _____   | |
_____         _____   | |


F(950)

Output

_____  _____
|| ||  _____
|| ||  _____
|| ||  _____
|| ||  _____


Ungolfed

F=n=>{
z='     1  |  1 | | 1 ||| 1|| ||1|||||1_____1__|__'.split(1);
s='';
n+=s;

for (r = 0; r < 5; r++)
{
for(q='\n',f=1,p=n.length;f=!f,p--;)
{
d = ~~n[p];
if (d)
{
e=d+r;
if (d > 5)
{
if (f)
{
d = e < 10 ? 1 : e >10 ? 6 : 7;
}
else
{
d = r ? d-5 : 6;
}
}
else
{
if (f)
d = e > 4 ? 6 : 0;
}
}
q = (p ? '  ' : '') + z[d] + q;
}
s+=q
}

console.log(s)
}