2007/5/17, Raul Miller <[EMAIL PROTECTED]>:
On 5/16/07, June Kim <[EMAIL PROTECTED]> wrote: > Have a look at this codegolf challenge : > http://codegolf.com/bob-ross-the-joy-of-ascii-art ... > The top(in terms of the source size) 17 codes are all written in Perl > and all 51 bytes long. > > I did it in J and it was longer than 51(maybe I didn't try it hard > enough?). Can anyone come up with a code shorter than 51?This contest is designed for perl -- a number of the requirements are implicit operations in perl. If I can get the input as a text variable -- or better yet, as a numeric matrix, and if I don't have to eliminate unused spaces and lines, I can do this transformation in less than 51 characters. For example: a.{~{."[EMAIL PROTECTED](<@}."[EMAIL PROTECTED])`((39 79$32)"_)}~|.@".;._2 in
That's similar to what I did. Thanks. (BTW, the size of the grid should be 80*40, according to the problem definition)
But... while J is great with regular arrays, dealing with irregular arrays gets complicated.
I concur wholeheartedly.
-- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
