
mhx
Enthusiast
/ Moderator
Oct 15, 2001, 10:05 PM
Post #2 of 8
(67421 views)
|
Re: Perl Golf to translate to Pig Latin
[In reply to]
|
Can't Post
|
|
I really hope to see some fancy answers!!! Anyway, I'd like to note some things. But first: Don't look at the attachment if you want to think about a solution yourself. I think limiting the solution to the provided skeleton disables the usage of (in this case) highly effective command line switches. (As you could see in the attachment if you were looking... ) Posting the correct output would be quite helpful. I haven't heard of Pig Latin up to now (as it seems it's not too popular in germany), but I think the correct solution would be:
appleway ellowyay yebay ourFay orescay andway evensay earsyay agoway ourway orefathersfay oughtbray orthfay... Please correct me immediately if I'm wrong. I found it quite hard in the beginning to match the description and the examples. (From the formal description, one [read: I] could think yellow would translate into yelloway. Note there's only one w.) However, good luck to all and happy golfing!! -- Marcus P.S.: And as I noticed just now as I tried to make my solution conforming with the rules, there's a typo in the example code. Just delete the closing brace right before __DATA__ .
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= ($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"
|