Ruby, 164142
f=->x{d='' _ _ _ _ _ _ _ _
| | | _| _||_||_ |_ ||_||_|
|_| ||_ _| | _||_| ||_| _|'
[0,31,62].maplines{|y|puts|l|puts x.chars.map{|i|d[i|i|l[i.to_i*3+yto_i*3,3]}.join}*''}
uses a function forexpects input in the variable x
. examples:
f['321']x = '321'
# _ _
# _| _| |
# _||_ |
f['42']x = '42'
# _
# |_| _|
# ||_