CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Fun With Perl: Perl Golf:
YAPH

 



yapp
User

Feb 19, 2002, 5:20 AM

Post #1 of 9 (33816 views)
YAPH Can't Post

Seeing all you guys golfing, even at the beginners forum, I wondered something.

- Who can write a YAPH*, with the least code.
- The YAPH still has to look "perl complex", in other words:
1. You shouldn't be able to read it, or see what the result is , without running it by perl first. (so I guess you don't need the spoiler tag Wink)
2. Just converting a hex string only using hex() is not good enough.

Good luck!

btw, *Yet Another Perl Hacker

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool

(This post was edited by yapp on Feb 19, 2002, 5:20 AM)


mhx
Enthusiast / Moderator

Feb 19, 2002, 9:22 AM

Post #2 of 9 (33800 views)
Re: [yapp] YAPH [In reply to] Can't Post


In Reply To
- Who can write a YAPH*, with the least code


FYI, it's normally called a JAPH. Wink

Here's my entry. Besides being a bit unreadable (as I hope), it has a nice little delay effect (at least on my HPUX machine) as if you were connected to the shell via a 300 baud modem. Also, it's golf score cannot be beaten: Once it has been run, it ends up as an empty text document which has obviously a golf score of zero. Tongue


Code
$/=$*,$|=$=,@ARGV=$0,($_=chop($*=<>))=~m&#&&&{$*=$,},truncate$0,length 
$*;$*||exit,y)J-y)G-v),print,exec'perl',,,$0#,uhnfdk ouhS uhkwrqd wvxM


Much fun, Cool

-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo



yapp
User

Feb 20, 2002, 8:56 AM

Post #3 of 9 (33794 views)
Re: [mhx] YAPH [In reply to] Can't Post


In Reply To
FYI, it's normally called a JAPH. Wink

Oeps!

However, I find this solution of yours very creative.
Are there any other forumers here, willing to try this golf out?

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


perldork
New User

Feb 21, 2002, 3:34 PM

Post #4 of 9 (33784 views)
Re: [yapp] YAPH [In reply to] Can't Post

I have read these things for years but never done one .. so my first
attempt .. not very pretty but somewhat noisy at least

print map{s/1//g;$_}map{s/44$//,sprintf sprintf('%cc',37),$_}(unpack(sprintf('%c%c',117,42),<DATA>)=~m/...?44(?!4)/g);__DATA__;
M-S0T-#$Q-S0T,3$U-#0Q,38T-#,R-#0Y-S0T,3$P-#0Q,3$T-#$Q-C0T,3`TM-#0Q,#$T-#$Q-#0T,S(T-#$Q,C0T,3`Q-#0Q,30T-#$P.#0T,S(T-#$P-#0T7.3<T-#DY-#0Q,#<T-#$P,30T,3$T-#0`


freddo
User

Feb 23, 2002, 5:42 PM

Post #5 of 9 (33769 views)
Re: [yapp] YAPH [In reply to] Can't Post

Hi,

I really like this one (check it out, it's called a quine):


Code
$a='JAPH'; print map "\$a='$a'; $_, q($_)", q(print map "\$a='$a';$_, q($_)")

Sadly it's not mine, I think the author is Tushar Samant. Check out Esoteric Topics in Computer Programming for more fun...

Freddo
;---


perldork
New User

Feb 25, 2002, 9:18 AM

Post #6 of 9 (33752 views)
Re: [freddo] YAPH [In reply to] Can't Post

Another try ... hex used, but not in the obviously dissallowed way (I think) :).


Code
print map{lc substr' aCehJklnopRStUzbcE980F#)r',hex$_,do{1;}}split//,qg5ecd0189d43b0a3b7041263bg



(This post was edited by perldork on Feb 25, 2002, 9:21 AM)


mhx
Enthusiast / Moderator

Mar 5, 2002, 1:38 PM

Post #7 of 9 (33723 views)
Re: [yapp] YAPH [In reply to] Can't Post

I knew I had to do this one day... Cool


Code
use Lingua::Romana::Perligata; 
meis novis da XLIV tum X. kcahere sic face cis rere sic da loco huic his
decapitamentum. meo novo. dum hoc fac sic praecidementum huic da meo nexto.
cum novum tum nextum serementum novo da cis novum redde cis tsuje queque
htonaeque. quere sic scribe indementum XXXII egresso cis tsujere sic face
unum cis htonaere sic face cis facere sic his decapitamentum vel nullum da
opto meo. textis meis da unum memoramenta. biguttam tum tertium textorum
scindementa nomis meis da. nisi optum tum unum aequalitam fac sic egresso
cum secundum nomorum rementum tum er scribe. sex redde cis cum secundum
nomorum rementum ampliamenta scribe egresso cis lrepere sic face unum cis
ianitorem queque lrepeque. nonum queque kcaheque. per quisque in novis fac
sic scribe indementum hoc egresso cis adnota lingua romana perligata mhx


-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo



yapp
User

Mar 6, 2002, 5:56 AM

Post #8 of 9 (33714 views)
Re: [mhx] YAPH [In reply to] Can't Post

CoolCoolCoolCoolCoolCoolCoolCoolCool

Can you translate it? It doesn't make sense to me.

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


mhx
Enthusiast / Moderator

Mar 6, 2002, 6:06 AM

Post #9 of 9 (33712 views)
Re: [yapp] YAPH [In reply to] Can't Post

It's a JAPH in Latin. I don't know if anyone has done something like that before, but I guess at least Damian has. Wink

Well, unless you speak Latin, the best way to find out what my code does is:

1. Install the [url=http://search.cpan.org/search?dist=Lingua-Romana-Perligata]Lingua::Romana::Perligata module
2. Run the code (and you see what it does)
3. Add one of the diagnostic arguments (as described in the manpage) to the module call (and you can see how it's done)

-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives