Gantt Golf

2003-10-28 Thread Riley
I'm new to the whole golfing game, and I'm trying to get my swing down... Regarding this last puzzle, I've created a solution (albeit extremely long in comparison to some of those I've seen in older puzzles), and in trying to get a feel for the shortcuts that all of you use, I'm wondering if perha

Re: Gantt Golf

2003-10-29 Thread Riley
ng problem using switches. It seems as though -n and -p would be extremely useful here, but I always get errors when I try via either a script or from the command line. Has anyone dealt with this? -Riley

Re: LED reader solutions

2003-11-10 Thread Riley
y thoughts? In addition, can anyone tell me why the code below was rejected? map{$i=0;y/ # /01/;map{$x[$i++].=$_}/(...)./g}<>;print map{index('\xf6\xde$\x92\xe7\xce\xe7\x9e\xb7\x92\xf3\x9e\xf3\xde\xe4\x92\xf7 \xde\xf7\x9e',pack B16,$_)/[EMAIL PROTECTED] -Riley (o0lit3) "Juho Sn

Re: A new golf "Reversi" has started

2003-11-22 Thread Riley
ion) makes the while loop run more than 4 times. (I have a feeling, however, that the loop is running many more than 9 times as in ton's alternate solution above, and on first glance, I would have declared that we had created an infinite loop.) Many thanks, Riley o0lit3

Re: Permutations

2004-02-02 Thread Riley
nd the rule, I'll know not to make the mistake again, but if we want to talk about modifiying the rules as to avoid any confusion, I think rule #3 "..should always be correct" should be changed to ..."MUST always be 100% correct." That way a newbie who hasn't gone through the most recent golf will be more wary when using rand... Thanks for the help. -Riley (o0lit3)

Loopy

2004-02-11 Thread Riley
Hello All! Is it normal to get to a point where you don't really know what your code is actually doing? I'm really suspicious of my current solution. Any chances on an enhanced testsuite? -Riley (o0lit3)

Number of odd divisors

2004-02-12 Thread Riley
sor, there will be a corresponding summation. The reason even divisors don't allow this should be obvious: we need an odd number of components in order to be able to add the same amounts on the right that we subtracted from the left... -Riley (o0lit3) P.S. - Note the following example as well

Re: A new golf "Cardtrick" has started

2004-03-03 Thread Riley
just a coincidence, the fact that our y-intercept is also a power of 3, and not just any power of the three, but the next in sequence? -Riley (o0lit3) P.s. -My solution: -plaF [EMAIL PROTECTED]/2-/ . (.)/*28+9*$'+3*$1+$&]Why is it that I always forget that I don't need the -F switch w

Re: A new golf "Subproduct" has started

2004-03-22 Thread Riley
ode}/'s!{code}!{code}!'.'e'x5/ee or: eval 's/{code}/{code}/'.'e'x5 Thanks -Riley (o0lit3)

Re: gentest.pl v 0.28

2004-03-24 Thread Riley
? Thanks -Riley "Ton Hospel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Note for golf preparers: A new version of gentest.pl is out. > Get it from http://www.xs4all.nl/~thospel/golf/gentest.pl > > Mainly changes to make life easy for test developers: &g

Re: gentest.pl v 0.28

2004-03-24 Thread Riley
After reading the rules again, I answered my own question: "...Also, any digit in the input will be part of a backreference..." Thanks, Riley "Ton Hospel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Note for golf preparers: A new version of gen

Obfuscation

2004-03-30 Thread Riley
Hello All! While we're waiting for the new golf, I wanted to share with everyone a new script that I've written, and open it up to discussion. Kudos to those who can figure out what it does without running it... -Riley (o0lit3) #!/usr/bin/perl -l @J=(1);[EMAIL PROTECTED],1;[EMAIL PRO

Re: A new golf "Matrix" has started

2004-04-13 Thread Riley
Hello Ton! -lp /.+()(?{$n|=(${"@-"}.=$&)x=-index$&,0})^/}{$_=length$n I get 56 instead of 16 on the first test in the testsuite for the above solution. Also, can anyone tell me why the following doesn't work? -lp0 / /,$_&=$'./1+(?{$;|=$&x$^C})^/while++$^C;$_=length$ Cheers!-Riley (o0lit3)

Re: A new golf "Matrix" has started

2004-04-14 Thread Riley
ing formats in such a way that the solution runs as expected in Dos format, but not in Unix format? I thought the main difference in the two formats was in how carriage returns are saved, but maybe there's something more... -Riley (o0lit3)

Re: A new golf "Mayan number converter " has started

2004-06-11 Thread Riley
?{...}) block in the pattern match by somehow setting $_=$&? I tried doing this, but weird things started happening. -Riley (o0lit3)

Re: A new golf "Rush hour/Traffic Jam" has started

2004-06-25 Thread Riley
Hello Ton! Is it safe to assume that the target (exit) horizontal car will always be only two units in length? -Riley "Ton Hospel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > A new golf "Rush hour" is at http://terje2.perlgol

Re: rush hour

2004-06-30 Thread Riley
game trees again. I had a hell of a time avoiding those damn cycles. -Riley (o0lit3) "Jasper" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Golfers, > > Although I enjoyed it very much, I really don't think it deserver the > title minigolf. >

Triangles and More

2004-08-02 Thread Riley
hich (at least in my version) turns out to be of similar length: -l print 0|(1x pop)!~/^(11+)\1+$/ I'm writing the above from memory, so I'm not sure if it's exact. Does anyone know the origin of this algorithm? Was it the result of some ancient golf? Many thanks, Riley (o0lit3

Re: A new golf "Tennis Scoresheet" has started

2004-08-17 Thread Riley
until one player has a margin of two games per set? -Riley (o0lit3) "Mtv Europe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello All! > > New golf "Tennis Scoresheet" has started, thanks to TopMach: > http://terje2.perlgolf.org/~pgas/score.pl?func=rules&hole=67 > > -- > Mtv Europe

Permutations

2004-01-29 Thread J. Riley Bryant
27;d be extremely interested to see it. Now the pertinent question: Does a solution with this probability *really* violate rule #3? I would wager that it's more likely that our "perfect" computer would get struck by lightening than our output not being correct. And what if we were

RE: Permutations

2004-01-30 Thread J. Riley Bryant
1001 1101 0010 0110 1010 1110 0011 0111 1011 So I think the problem may be that ((n!-1)/n!)^4 is the probabilty that I will not choose any one particular item. But I need the probability that I won't choose ANY particular item! make f(n) = 1 - (n * ((n!-1)/n!)^x) so in our case f(n

Permutations

2004-01-30 Thread J. Riley Bryant
ses, making the code only practical for n <= 4.) #!/usr/bin/perl -l sub f {$_[0]<2?$_[0]:$_[0]*f($_[0]-1)} sub g { $_[2]=$_[0]**$_[1]; $_[2]-=(f($_[0])/(f($_[0]-$_)*f($_)))*g($_,$_[1])for 1..$_[0]-1; $_[2] } print g(f($ARGV[0]),$ARGV[1])/f($ARGV[0])**$ARGV[1] ## Riley ## (o0lit3)

Permutations

2004-01-30 Thread J. Riley Bryant
endent. Would we see the above differences on every machine? -Riley (o0lit3)

Permutations

2004-01-30 Thread J. Riley Bryant
ermutations of n items with x random selections. (Please note that running time increasing dramatically as n increases, making the code only practical for n <= 4.) #!/usr/bin/perl -l sub f {$_[0]<2?$_[0]:$_[0]*f($_[0]-1)} sub g { $_[2]=$_[0]**$_[1]; $_[2]-=(f($_[0])/(f($_[0]-$_)*f($_)))*g($_,$_[1])for 1..$_[0]-1; $_[2] } print g(f($ARGV[0]),$ARGV[1])/f($ARGV[0])**$ARGV[1] ## Riley ## (o0lit3)

Permutations

2004-01-30 Thread J. Riley Bryant
ith x random selections. (Please note that running time increasing dramatically as n increases, making the code only practical for n <= 4.) #!/usr/bin/perl -l sub f {$_[0]<2?$_[0]:$_[0]*f($_[0]-1)} sub g { $_[2]=$_[0]**$_[1]; $_[2]-=(f($_[0])/(f($_[0]-$_)*f($_)))*g($_,$_[1])for 1..$_[0]-1; $_[2] } print g(f($ARGV[0]),$ARGV[1])/f($ARGV[0])**$ARGV[1] ## Riley ## (o0lit3)