Seven-segment indicator

Write translator from decimal numbers to ascii pictures à la seven-segment indicator http://en.wikipedia.org/wiki/Seven-segment_display

IN

8

OUT

 _ 
|_|
|_|

IN

12

OUT

    _ 
  | _|
  ||_ 

IN

917

OUT

 _     _ 
|_|  |  |
 _|  |  |
Login to submit solution


54 symbols pyth
Thu Nov 3 18:45:54 2016 Sait2000
.v.ZCim-id64^964 2cCM"จ闦怘撐輈ጾꢈ➕አ蹁ꈤ궢⶜−俐랶毑団⦐磶ẘ"3^4 8
55 symbols pyth
Thu Nov 3 18:43:21 2016 Sait2000
.vCim-id64^964 2cCM"旐烺磺皲䏇䓆䗹矉䓻䏺䛇篆䗹磹篇䓁燉䏻䓼㺲䃆ⷆ槅㋕䓰嫥䆲沰᠌"3^4 8
58 symbols pyth
Wed Oct 19 14:51:44 2016 Sait2000
X@cjkji"67768ij97k6j97n68ikin771d96k7l1"36 6\5%Q7`MU4"_ 
|
60 symbols pyth
Wed Oct 19 14:43:28 2016 Sait2000
X@c.Oi"480lf4x0otp2i5ipymdqbepkwddaenqc0mo1"36\5%Q7`MU4"_ 
|
61 symbols pyth
Wed Oct 19 14:41:59 2016 Sait2000
X@c.Oi"480lf4x0otp2i5ipymdqbepkwddaenqc0mo1"36\5%Q7r\0\4"_ 
|
62 symbols pyth
Wed Oct 19 14:39:39 2016 Sait2000
X@c.Oi"480lf6jrdcwk0diexregafotnlriltepcebl"36\5%Q7r\0\4"_ |
"
63 symbols pyth
Wed Oct 19 14:37:05 2016 Sait2000
X@c.Oi"480lf6jrdcwk0diexregafotnlriltepcebl"36\5%Q7"0123""_ |
"
72 symbols pyth
Mon Oct 17 09:21:14 2016 Sait2000
@[" _     _ 
|_|  |  |
 _|  |  |"" _ 
|_|
|_|""    _ 
  | _|
  ||_ ")%Q7
87 symbols perl
Tue Feb 17 18:19:52 2015 vakorol
#!/usr/bin/perl -p0
$_=[" _ 
|_|
|_|","    _ 
  | _|
  ||_ "]->[$_/4-2]||" _     _ 
|_|  |  |
 _|  |  |"
91 symbols perl
Mon Feb 16 13:44:36 2015 bugov
#!/usr/bin/perl -p0
$_={8," _ 
|_|
|_|",12,"    _ 
  | _|
  ||_ ",917," _     _ 
|_|  |  |
 _|  |  |"}->{$_}
97 symbols perl
Mon Sep 29 14:30:50 2014 vakorol
#!/usr/bin/perl -p0
$_={8," _ \n|_|\n|_|",12,"    _ \n  | _|\n  ||_ ",917," _     _ \n|_|  |  |\n _|  |  |"}->{$_}
148 symbols python2
Wed Aug 13 02:24:40 2014 PFischbeck
i=`input()`
s=['|_ ',' _ ','|_|',' _|','  |','   ']
a={1:544,2:130,7:144,8:122,9:123}
for n in 0,1,2:print''.join(s[int(`a[int(c)]`[n])] for c in i)
157 symbols perl
Sat Jun 14 16:30:37 2014 danieljabailey
#!/usr/bin/perl -naF
@b=('  |','|_ ','','','','','  |','|_|',' _|');for$i(0..2){for(@F){print$i==0?($_>1?' _ ':'   '):$i==1?($_>7?'|_|':$_==2?' _|':'  |'):@b[$_-1];}print$/;}
167 symbols python2
Wed Aug 13 02:07:50 2014 PFischbeck
i=input()
s=['   ',' _ ','|_|',' _|','  |','|_ ']
a=['','044','135','','','','','144','122','123']
for n in 0,1,2:
 r=''
 for c in `i`:r+=s[int(a[int(c)][n])]
 print r
201 symbols perl
Fri Jun 13 17:50:39 2014 danieljabailey
#!/usr/bin/perl -naF
$u='|_|';$l=' _|';$s='  |';@a=('| |',$s,$l,$l,$u,'|_ ','|_ ',$s,$u,$u);@b=($u,$s,'|_ ',$l,$s,$l,$u,$s,$u,$l);for$i(0..2){for(@F){print$i==0?($_!=1&&$_!=4?' _ ':'   '):$i==1?@a[$_]:@b[$_];}print$/;}
209 symbols python3
Wed Feb 5 18:47:03 2014 maksim
n = input('')
d = ['   ','  |',' _ ',' _|','','| |','|_ ','|_|']
l = ['257','011','236','233','071','263','267','211','277','273']
for p in range(3):
	s = ''
	for c in n:
		s += d[int(l[int(c)][p])]
	print(s)
216 symbols perl
Fri Jun 13 05:03:37 2014 danieljabailey
#!/usr/bin/perl -naF
$u='|_|';$l=' _|';$s='  |';for(@F){print(($_!=1&&$_!=4)?' _ ':'   ');}print$/;for(@F){print@a=('| |',$s,$l,$l,$u,'|_ ','|_ ',$s,$u,$u)[$_];}print$/;for(@F){print@a=($u,$s,'|_ ',$l,$s,$l,$u,$s,$u,$l)[$_];}print$/;
258 symbols perl
Mon Jan 13 02:11:07 2014 Logioniz
#!/usr/bin/perl -naF//
@n=(490,288,242,434,312,410,474,290,506,442);
for (1..3) {
        for $j(@F) {
                for$k(0..2) {
                        print $n[$j]&1?($k==1?'_':'|'):' ';
                        $n[$j]/=2;
                }
        }
        print $/;
}
304 symbols haskell
Wed Mar 18 08:37:32 2015 YoshikuniJujo
import Data.List
main=interact$unlines.map concat.transpose.reverse.map(m.(i!!)).unfoldr u.read
o=[0,0,1,0,0,1]
p=[1,1,1,1,0]
u 0=Nothing
u n=Just(n`mod`10,n`div`10)
v=" |"
m[a,b,c,d,e,f,g]=[["   "," _ "]!!a,[v!!b," _"!!c,v!!d],[v!!e," _"!!f,v!!g]]
i=[[],0:o,1:0:p,[],[],[],[],1:o,replicate 7 1,p++[1,1]]

View all solutions