A basic solution is
T=: 10 3 3$' _ | ||_| | | _ _||_ _ _| _| |_| | _ |_ _| |_ |_| _
| | _ |_||_| _ |_| |'
seven_seg=:[:,./T{~_48+a.&i.
seven_seg '314159'
_ _ _
_| ||_| ||_ |_|
_| | | | _| |
And then you are just looking at shorter ways of generating T .
This does not seem that interesting as a J puzzle.
----- Original Message -----
From: "June Kim" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Tuesday, April 18, 2006 7:56 PM
Subject: [Jprogramming] Seven Segment Display -- shortest solution
There was a shortest python coding contest recently. The job is to
make a function that converts decimal numbers(given as a string) to
the seven-segment display. For more description and test codes, visit
http://www.pycontest.net/job
The winner's code was 119 bytes and he reduced it to 117 characters
afterwards. (the result is at http://www.pycontest.net/ranking/)
How short could it be in J?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm