Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On 4 Feb 2002, at 16:32, Jeff 'japhy' Pinyan wrote: On Feb 4, Yanick said: On Mon, Feb 04, 2002 at 05:35:08PM +0100, Philippe 'BooK' Bruhat wrote: Or a perlish wheel of fortune. I will take the dollar sign... *ding* *ding* *ding* *ding* *ding* *ding* *ding* *ding* *ding* *ding* I have an interesting idea. Take Perl code, and jumble it around to something else (valid or not) and state the original code's purpose. # find all prime numbers $_||=(1)^(\1/~++$$)while +x._/+1;print The comment is correct, the code has been jumbled. More of a puzzle than a contest, but a neat idea. Even better if the jumbled problem is valid and does something else Or you have the jumble and TWO or THREE [valid] programs to un-jumble it into... /Bernie\ -- Bernie Cosell Fantasy Farm Fibers mailto:[EMAIL PROTECTED] Pearisburg, VA -- Too many people, too few sheep --
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On Feb 4, Dave Hoover said: Maybe it could be made into more of a contest by seeing HOW MANY working programs one can create from a chunk of jumbled code. Yeah, but that can be brute-forced with an algorithm. -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for Regular Expressions in Perl published by Manning, in 2002 ** stu what does y/// stand for? tenderpuss why, yansliterate of course.
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
Jeff 'japhy' Pinyan [EMAIL PROTECTED] wrote: On Feb 4, Dave Hoover said: Maybe it could be made into more of a contest by seeing HOW MANY working programs one can create from a chunk of jumbled code. Yeah, but that can be brute-forced with an algorithm. Good point. --Dave __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On Mon, Feb 04, 2002 at 04:32:29PM -0500, Jeff 'japhy' Pinyan wrote: I have an interesting idea. Take Perl code, and jumble it around to something else (valid or not) and state the original code's purpose. # find all prime numbers $_||=(1)^(\1/~++$$)while +x._/+1;print The comment is correct, the code has been jumbled. (1x$_)=~/^(.1+)\1+$/||print while++$_ and int he grand tradition of putting stuff back together, I'm left with one ';' too many. Joy, `/anick -- print map { ( split '', 'P arctehYkl.no' )[ hex ] } split '', '86512cd57631063a1724963b';
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On Feb 4, Yanick said: On Mon, Feb 04, 2002 at 04:32:29PM -0500, Jeff 'japhy' Pinyan wrote: # find all prime numbers $_||=(1)^(\1/~++$$)while +x._/+1;print (1x$_)=~/^(.1+)\1+$/||print while++$_ and int he grand tradition of putting stuff back together, I'm left with one ';' too many. Oh, come now. You know the ; is for the end, and it doesn't hurt to have it there. -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for Regular Expressions in Perl published by Manning, in 2002 ** stu what does y/// stand for? tenderpuss why, yansliterate of course.
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On Mon, Feb 04, 2002 at 05:14:51PM -0500, Yanick wrote: On Mon, Feb 04, 2002 at 04:32:29PM -0500, Jeff 'japhy' Pinyan wrote: I have an interesting idea. Take Perl code, and jumble it around to something else (valid or not) and state the original code's purpose. # find all prime numbers $_||=(1)^(\1/~++$$)while +x._/+1;print The comment is correct, the code has been jumbled. (1x$_)=~/^(.1+)\1+$/||print while++$_ That's what I had (module layout) but couldn't figure out how to get rid of the initial 1, which isn't prime. The jumbling shuffles the meaning of the tokens, e.g. ||= is one token in the problem and two (|| and =) in the solution. Kudos to anyone who puts together a problem where alphabetic tokens and [say] regex modifiers (unless, while, /eis, c) transmute into other alphabetic tokens for the solution... Paul
Re: Flog - Golf Anagrams (was Re: Flog. Re: substitution question)
On Feb 4, Paul Makepeace said: $_||=(1)^(\1/~++$$)while +x._/+1;print (1x$_)=~/^(.1+)\1+$/||print while++$_; That's what I had (module layout) but couldn't figure out how to get rid of the initial 1, which isn't prime. That's a minor flaw of the program, and is implicitly excused. The jumbling shuffles the meaning of the tokens, e.g. ||= is one token in the problem and two (|| and =) in the solution. Kudos to anyone who puts together a problem where alphabetic tokens and [say] regex modifiers (unless, while, /eis, c) transmute into other alphabetic tokens for the solution... It was a mere coincidence that I decided to keep the two |'s together -- there was no need to, really. For examples, I use / for division instead of as a regex, and =~ has been broken up. -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for Regular Expressions in Perl published by Manning, in 2002 ** stu what does y/// stand for? tenderpuss why, yansliterate of course.