Re: Minigolf "Power Crisis" has started

2002-09-20 Thread Mtv Europe
Hello All! [EMAIL PROTECTED] (Mtv Europe) wrote: > New "Power Crisis" minigolf is available on the system > http://terje.dev.webon.net/golf/ It turned out, that "power crisis" was very prophetical name and as a direct result of this, last night system was unavailable. We make our apologies to t

Re: minigolf

2002-08-17 Thread Adam Spiers
Terje Kristensen ([EMAIL PROTECTED]) wrote: > One big difference is that in the minigolf, we dont submit > solutions, just the score. in this way you dont need a ref to check > solutions, and the person who holds the contest can also play. > > we use the same testscript, so there you have some r

Re: minigolf

2002-08-15 Thread Terje Kristensen
46 +0100 To: [EMAIL PROTECTED] Subject: Re: minigolf Re: Terje Kristensen ([EMAIL PROTECTED]) wrote: Re: > It's been over a week since the TPR04c ended now, so i think it's time for another minigolf. :) Re: > Re: > This time it's a joint effort by myself and Mtve. Re:

Re: minigolf

2002-08-15 Thread Adam Spiers
Terje Kristensen ([EMAIL PROTECTED]) wrote: > It's been over a week since the TPR04c ended now, so i think it's time for another >minigolf. :) > > This time it's a joint effort by myself and Mtve. > > http://terje.dev.webon.net/golf/ Every time I see these mini-golfs come up I think what a cry

Re: minigolf

2002-07-10 Thread Phil Carmody
--- Phil Carmody <[EMAIL PROTECTED]> wrote: > 0: 47 > 1: 47 0: 46 1: 46 _Now_ I think I'm at a dead end, and would require a new algorithm. Phil = -- "One cannot delete the Web browser from KDE without losing the ability to manage files on the user's own hard disk." - Prof. Stuart E Madn

Re: Minigolf

2002-05-29 Thread Philippe 'BooK' Bruhat
En réponse à Benoît Chauvet <[EMAIL PROTECTED]>: > From: "Peter Makholm" <[EMAIL PROTECTED]> > > > Anyone ready to exploit that you can write to the script? > > Waooo ! Sound great ! > > But the rules does not mention if the script must pass the tests twice. > (if it can modify itself, maybe i

Re: Minigolf

2002-05-29 Thread Eugene van der Pijll
En op 29 mei 2002 sprak Benot Chauvet: > > Anyone ready to exploit that you can write to the script? > > Waooo ! Sound great ! > > But the rules does not mention if the script must pass the tests twice. The script, *as originally written*, should pass the tests every time it is run. The state o

Re: Minigolf

2002-05-29 Thread Benoît Chauvet
- Original Message - From: "Peter Makholm" <[EMAIL PROTECTED]> > Anyone ready to exploit that you can write to the script? Waooo ! Sound great ! But the rules does not mention if the script must pass the tests twice. (if it can modify itself, maybe it will become unusable after the fir

Re: Minigolf

2002-05-29 Thread Ton Hospel
In article <[EMAIL PROTECTED]>, Peter Makholm <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Ton Hospel) writes: > >> This is not the first time I've been wondering about the exact form of $0. >> I'd also like a judgement if `$0 args` is allowed (probably not ok), >> and even `$^X $0 ar

Re: Minigolf

2002-05-29 Thread Peter Makholm
[EMAIL PROTECTED] (Ton Hospel) writes: > This is not the first time I've been wondering about the exact form of $0. > I'd also like a judgement if `$0 args` is allowed (probably not ok), > and even `$^X $0 args` (probably ok). It is usual with something like the following rule: - The program m

Re: Minigolf

2002-05-28 Thread Ton Hospel
In article , [EMAIL PROTECTED] (Ton Hospel) writes: > In article <[EMAIL PROTECTED]>, > Lolly Pop <[EMAIL PROTECTED]> writes: >> #!perl -l >> print$n-map$n+=@a%$_?0:$_,@a=1..pop >> > > Yup, you found the 38 (don't you dare to enter the next TPR > as be

Re: Minigolf

2002-05-17 Thread Ton Hospel
In article <[EMAIL PROTECTED]>, Lolly Pop <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Jonathan e. paton) writes: > >> It might not be the winning solution, but you missed >> a character optimisation suggested earlier: >> >> #!perl -l >> map$n+=$m%$_?0:$_,1..($m=pop)/2;print$n > > Y

Re: Minigolf

2002-05-17 Thread Lolly Pop
[EMAIL PROTECTED] (Jonathan e. paton) writes: > It might not be the winning solution, but you missed > a character optimisation suggested earlier: > > #!perl -l > map$n+=$m%$_?0:$_,1..($m=pop)/2;print$n You can knock this down some more (38?) by using the return value of map to correct the ove

Re: Minigolf

2002-05-17 Thread Jonathan E. Paton
> > ... > > OK, then, how about: > > #!perl -l > $m=pop;map$n+=$m%$_?0:$_,1..$m/2;print$n > > Which is still a 43. The map saves a couple of > characters. I don't think this one has legs, tho'; > I can't see much more that can be reduced from it. > But then, I'm not a very good golfer.

Re: Minigolf

2002-05-17 Thread Stephen Turner
On Thu, 16 May 2002, Ryan Russell wrote: > > Does anyone have any hints for someone new at this? It seems like a lot > of the golf relies on less-known side-effects. I'm wondering if someone > has started documenting the tricks. I'm going to need a few hints before > I'm able to read and compr

Re: Minigolf

2002-05-16 Thread michael
>Unfortunately you don't. This solution misses the requested \n, fixing >that makes it a 46 OK, then, how about: #!perl -l $m=pop;map$n+=$m%$_?0:$_,1..$m/2;print$n Which is still a 43. The map saves a couple of characters. I don't think this one has legs, tho'; I can't see much more t

Re: Minigolf

2002-05-16 Thread Rick Klement
Ton Hospel wrote: > > Oh, notice that the 37 solution uses something which would > start the judges discussing, might be rejected and will need > a rules amendment (either explicitely allowing or disallowing > it) for future golfs (judges for TPR4, take note !). *mad cackles* -- Rick Klement

Re: Minigolf

2002-05-16 Thread Eugene van der Pijll
En op 16 mei 2002 sprak Ryan Russell: > > > Hang on... can't that be changed to: > > > > > > $m=pop;$n+=$m%$_?0:$_ for 1..$m-1;print$n > > > > > > you might be able to get rid of the space between "for 1". > > No, needs the sapce. Nope. Of course, you can't just delete it, but spaces around a

Re: Minigolf

2002-05-16 Thread Chris Dolan
[EMAIL PROTECTED] wrote: >>-Original Message- >>From: Ryan Russell [mailto:[EMAIL PROTECTED]] >>Newbie question, why does it only add 3 characters? I would >>have to add >>,"\n" (5) with what (little) I know. Wait... >>print"$n\n" >>OK, so 4 then. > > print$n.$\ or #perl -l print$n o

RE: Minigolf

2002-05-16 Thread Tony . Young
> -Original Message- > From: Ryan Russell [mailto:[EMAIL PROTECTED]] > > On Fri, 17 May 2002, Ton Hospel wrote: > > > Unfortunately you don't. This solution misses the requested > \n, fixing > > that makes it a 46 > > OK, thanks. I was getting a new line after running my program, but

Re: Minigolf

2002-05-16 Thread Ryan Russell
On Fri, 17 May 2002, Ton Hospel wrote: > Unfortunately you don't. This solution misses the requested \n, fixing > that makes it a 46 OK, thanks. I was getting a new line after running my program, but I wasn't sure if the artifact of the way it was run counted or not, and I didn't see any obviou

Re: Minigolf

2002-05-16 Thread Ton Hospel
In article , [EMAIL PROTECTED] (Ton Hospel) writes: > Here's a small challenge that I set people on ircnet #perl: > > minigolf: write a program that, given argument n, prints to stdout the sum > of the factors of n followed by a newline, e.g. "program 12" shou

Re: Minigolf

2002-05-16 Thread Ton Hospel
In article <[EMAIL PROTECTED]>, "Jonathan E. Paton" <[EMAIL PROTECTED]> writes: >> > This is in fact unexpectedly challenging. a 43 is easy. A 40 is hard. >> >> Here's mine >> >> $m=pop;for(1..$m-1){$n+=$m%$_?0:$_}print $n >> >> 43, if I understand the rules correctly. (First attempt a

Re: Minigolf

2002-05-16 Thread Jonathan E. Paton
> > This is in fact unexpectedly challenging. a 43 is easy. A 40 is hard. > > Here's mine > > $m=pop;for(1..$m-1){$n+=$m%$_?0:$_}print $n > > 43, if I understand the rules correctly. (First attempt at this... been > wanting to play since I read about it on /.) Hang on... can't that be changed

Re: Minigolf

2002-05-16 Thread Ryan Russell
On Thu, 16 May 2002, Ton Hospel wrote: > This is in fact unexpectedly challenging. a 43 is easy. A 40 is hard. Here's mine $m=pop;for(1..$m-1){$n+=$m%$_?0:$_}print $n 43, if I understand the rules correctly. (First attempt at this... been wanting to play since I read about it on /.) Does anyo

RE: Minigolf

2002-05-16 Thread gary
Benoît Chauvet wrote: > > > Fun, but none too impressive: > > > > #!perl -l > > (1x pop)=~/^(1+)\1+$(?{$x+=$+[1]})./;print$x > > > > Can't break 41. G. > > This one is 48 stokes, isn't it ? > By the way, would you explain the meaning of $+[1] ? > Is this a not documented perlvar @+ ? > 47,

Re: Minigolf

2002-05-16 Thread Prakash Kailasa
On Thu, May 16, 2002 at 06:19:43AM -0500, [EMAIL PROTECTED] wrote: > Fun, but none too impressive: > > #!perl -l > (1x pop)=~/^(1+)\1+$(?{$x+=$+[1]})./;print$x Interesting. However, this segfaults for 65535 on Linux and Solaris (both v5.6.1), and gives incorrect result of 45920 on Windows 2000

Re: Minigolf

2002-05-16 Thread Benoît Chauvet
> perldoc perlvar > /LAST_MATCH_END Excuse me FX, you were right, but I was stupid enough to use the (not complete) french translations of perldoc. Forgive me and forget those mails, golfers... :s -- |3enoît, going back to bed 'till June 1stin perlvar.

Re: Minigolf

2002-05-16 Thread Adam Spiers
Benoît Chauvet ([EMAIL PROTECTED]) wrote: > It certainly means that @+ contains the position of the last character of > last match in the original string, followed by the positions of the last > characters of the groups. > > Terrific ! > > Damn, I don't have time (nor talent and sufficient knowl

Re: Minigolf

2002-05-16 Thread F . Xavier Noria
On Thu, 16 May 2002 15:19:46 +0200 Beno <[EMAIL PROTECTED]> wrote: : So I keep asking : what does @+ mean ? You need to know the captured number to increment $x, but there you have a handful of 1s in a row, the (IMHO clever) trick is to retrieve the actual divisor asking for an offset via @+. Lo

Re: Minigolf

2002-05-16 Thread F . Xavier Noria
On Thu, 16 May 2002 15:19:46 +0200 Beno <[EMAIL PROTECTED]> wrote: : So I keep asking : what does @+ mean ? You need to know the captured number to increment $x, but there you have a handful of 1s in a row, the (IMHO clever) trick is to retrieve the actual divisor asking for an offset via @+. Lo

Re: Minigolf

2002-05-16 Thread Benoît Chauvet
Hey, I managed to find the answer alone, with this script : #!perl -l $,=';'; $_="-a--cc---"; /(a+)-+(b+)-+(c+)-/; print "1234567890123"; print; print @+; which outputs : 1234567890 -a--cc--- 11;2;7;10 It certainly means that @+ contains the position of the last character of last match

Re: Minigolf

2002-05-16 Thread Benoît Chauvet
- Original Message - From: "F.Xavier Noria" <[EMAIL PROTECTED]> > : By the way, would you explain the meaning of $+[1] ? > : Is this a not documented perlvar @+ ? > > perldoc perlvar > /LAST_MATCH_END Thanks, but then, I'll reformulate my question : I know $+, and I know Perldoc ;) , bu

Re: Minigolf

2002-05-16 Thread F . Xavier Noria
On Thu, 16 May 2002 13:56:48 +0200 Beno <[EMAIL PROTECTED]> wrote: : > Fun, but none too impressive: : > : > #!perl -l : > (1x pop)=~/^(1+)\1+$(?{$x+=$+[1]})./;print$x : > : > Can't break 41. G. : : By the way, would you explain the meaning of $+[1] ? : Is this a not documented perlvar @+ ?

Re: Minigolf

2002-05-16 Thread Benoît Chauvet
- Original Message - From: <[EMAIL PROTECTED]> To: "'Ton Hospel'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, May 16, 2002 1:19 PM Subject: RE: Minigolf > Fun, but none too impressive: > > #!perl -l > (1x pop)=~/^(1+)\1+$

RE: Minigolf

2002-05-16 Thread gary
Fun, but none too impressive: #!perl -l (1x pop)=~/^(1+)\1+$(?{$x+=$+[1]})./;print$x Of course, Abigail is entirely to blame for this solution. I was a bit surprised to discover that $_ is set to the regex string within the re-eval, so I couldn't use it for the accumulator. Can't break 41. Grrr