Re: Some random reflections on tpr05a

[email protected] ((Ton Hospel))
Newsgroups perl.golf
Organization lunix confusion services
Message-ID <[email protected]>
In article <[email protected]>,
	Rick Klement <[email protected]> writes:
> [email protected] wrote:
>> 
>> If anyone has a working tpr05a solution using Parse::RecDescent
>> or other CPAN module can you please post it to the list, as I
>> am also interested in comparing that solution to the others.
> 
--snip--
> 
> Also, instead of using Parse::RecDescent, I did my own recursive
> descent parser, and submitted it in the "Artistic" section at 141.36 (though
> as the comment says, it's really a 137).
> 
> 
> #!perl -p
> sub o{print$"x$|++,shift}
> sub f{s/^-*\d+//?o$&:e(s/.//)+s/.//}
> sub t{f;o$&x1,f while s+^[*/]++}
> sub e{t;o$&x1,t while s/^[+-]//}
> e y/ 	//d
> 
> 
> This would have scored in the middle of the pack, instead of the
> actual depressing position I finished in.
> 

Notice that my 103 solution is something like that, just written very
compactly. I submitted all basic inbetween steps, so you can actually
see it evolve in the post-mortem.

After giving up on overload I had deluded myself into thinking it needs 
a real parser. Oh well. I console myself that I at least had the shortest
clean recursive descent and the shortest overload solution.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.