Front page | perl.fwp |
Postings from December 2001
Santa Hole 4 (mid.pl) Post Mortem
Thread Next
From:
Andrew.Savige
Date:
December 6, 2001 15:58
Subject:
Santa Hole 4 (mid.pl) Post Mortem
Message ID:
694BB7191495D51183A9005004C0B05408DFD8@ir-exchange-srv.ir.com.au
This hole, arguably the most interesting of the set, was
won by Eugene with his first post in the opening hours
of the game. He got off to a fast start because he had
just analysed a similar problem from a previous fwp
"middle line" thread (in fact, I blame Yanick for this
golf game, and he blames Greg Bacon, and he blames...).
The following elegant 26-character solution, first found
by Ronald J Kimball, proved popular:
#!/usr/local/bin/perl
@n=<>;print@n[$#n/2..@n/2]
Piers and Karsten both found shorter multi-line solutions:
Piers:
"Grr... that one line rule is *so* silly:"
#!/usr/bin/perl -p0
$_=$1while/
(.+)^/ms
Karsten:
#!/usr/bin/perl -p0
$_=$1while/
(.*
)./s
Oh well, I will leave it up to Eugene the Arbiter to decide
on the scoring rules for the Easter Apocalypse, but Piers and
Karsten, at least, will lobby vigorously to allow muliple lines.
*** Hole 4 (mid.pl) ***
--- Piers Cawley --------------------- 25
#!/usr/bin/perl -p0
$_=$1while/.(^.+)^/ms
--- Rick Delaney --------------------- 25
#!/usr/bin/perl -p0
$_=$1while/.^(.+)^/sm
--- Karsten Sperling ----------------- 25
#!/usr/bin/perl -p0
$_=$1while/.(^.+^)/sm
--- Eugene van der Pijll ------------- 25
#!/usr/bin/perl -p0
$_=$1while/.^(.+)^/ms
--- Keith C Ivey --------------------- 25
#! /usr/bin/perl -p0
$_=$1while/.(^.+)^/ms
--- Rick Klement --------------------- 26
@F=<>;print@F[$#F/2..@F/2]
--- Ala Qumsieh ---------------------- 26
#!perl -p0
$_=$1while/\n(.+\n)./s
--- me-01@ton.iguana.be -------------- 26
#!/usr/bin/perl
@F=<>;print@F[$#F/2..@F/2]
--- BooK ----------------------------- 26
#!/usr/bin/perl -p0
$_=$1while/\n(.*\n)./s
--- Brad Greenlee -------------------- 26
@a=<>;print@a[$#a/2..@a/2]
--- Richard Proctor ------------------ 26
@_=<>;print@_[$#_/2..$./2]
--- Damian James --------------------- 26
@z=<>;print@z[$#z/2..@z/2]
--- Michael G Schwern ---------------- 26
#!/usr/bin/perl
@a=<>;print@a[$#a/2..@a/2]
--- Mark Suter ----------------------- 26
#!/usr/bin/perl
@A=<>;print@A[$#A/2..@A/2]
--- Ian Phillipps -------------------- 26
#!/usr/bin/perl
@x=<>;print@x[$#x/2..@x/2]
--- Japhy ---------------------------- 26
#!/usr/bin/perl
@_=<>;print@_[$#_/2..@_/2]
--- Robin Houston -------------------- 26
@_=<>;print@_[$#_/2..@_/2]
--- Ronald J Kimball ----------------- 26
#!/usr/local/bin/perl
@n=<>;print@n[$#n/2..@n/2]
--- Scott Wessels -------------------- 26
#!/usr/bin/perl -p0
$_=$1while/\n(.*\n)./s
--- Vladi Belperchinov-Shabanski ----- 26
#!/usr/bin/perl -p0
$_=$1while/\n(.*\n)./s
--- Yanick --------------------------- 26
#!/usr/bin/perl
@F=<>;print@F[$#F/2..@F/2]
--- Zed Lopez ------------------------ 26
@a=<>;print@a[$#a/2..@a/2]
--- Simon Drabble -------------------- 27
print@a[(@a=<>)/2-.5..$./2]
--- Tim Ayers ------------------------ 28
#!/usr/bin/perl
@a=<>;print@a[@a/2-.5..@a/2]
--- Jerome Quelin -------------------- 28
#!/usr/bin/perl
@_=<>;print@_[$./2-.5..$./2]
--- Ian Boreham ---------------------- 28
@a=<>;print@a[$./2-.5..$./2]
--- Jonathan E Paton ----------------- 29
#!/usr/bin/perl
@_=<>;print@_[--$./2..++$./2]
--- Dave O'Neill --------------------- 29
#!/usr/bin/perl
@a=<>;print@a[(@a-1)/2..@a/2]
--- Tony Payne ----------------------- 29
#!/usr/bin/perl -0p
$_=$1while/\n(.*\n).*\n/s
--- Anthony J Breeds-Taurima --------- 32
#!/usr/bin/perl
@_=<>;$_=$./2;print@_[$_-.5..$_]
--- Csaba Raduly --------------------- 33
#!perl -p0l12
chop;$_=$1while/\n(.*)\n/s
--- Michael Lambert ------------------ 33
@_=<>;print splice@_,$#_/2,2-@_%2
--- Evan A Zacks --------------------- 33
#!/usr/bin/perl
print@a[(@a=<>)%2?():@a/2-1,@a/2]
--- Josh Shulz ----------------------- 35
#!/usr/bin/perl
@a=<>;print splice @a,$#a/2,$#a%2+1
--- Aaron D Marasco ------------------ 50
#!/usr/bin/perl -n
$N[$.]=$_;END{print$.&1?'':$N[$./2],$N[$./2+1]}
--- anonymous ------------------------ 26
#!/usr/bin/perl -p0
$_=$1while/\n(.*\n)./s
--- anonymous ------------------------ 26
#!/usr/bin/perl
@a=<>;print@a[$#a/2..@a/2]
--- anonymous ------------------------ 26
#!/usr/bin/perl
print@F[(@F=<>)/2.1..@F/2]
--- anonymous ------------------------ 28
#!/usr/bin/perl
@a=<>;print@a[$./2-.5..$./2]
--- anonymous ------------------------ 29
#!perl -p0
$_=$1while/\n(.+\n).*\n/s
--- anonymous ------------------------ 34
#!/usr/bin/perl
@_=<>;print splice@_,--$./2,1+$.%2
--- anonymous ------------------------ 36
#!/usr/bin/perl
@a=<>;print splice(@a,$#a/2,$#a%2+1)
--- anonymous ------------------------ 37
#!/usr/bin/perl
@a=<>;@a&&print@a[@a/2-!(@a&1)..@a/2]
Thread Next
-
Santa Hole 4 (mid.pl) Post Mortem
by Andrew.Savige