Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Google CodeJam?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alex Wegel  
View profile  
 More options Apr 25 2012, 8:25 am
Newsgroups: comp.lang.forth
From: awe...@arcor.de (Alex Wegel)
Date: Wed, 25 Apr 2012 14:25:48 +0200
Local: Wed, Apr 25 2012 8:25 am
Subject: Re: Google CodeJam?

Alex Wegel <awe...@arcor.de> wrote:
> Another remark: In my even more rusty perl, it was much simpler to do
> quick & dirty (by following the suggestion to change the ()'s to []'s):

I wasn't happy with the clumsy perl code i wrote, so i tried again:

#!/usr/bin/perl
my ($l, $d, $n) = split " ",<>;
while ($d--) { push @d, scalar <>; }
$c=0;
while (<>) {
        ($p = $_) =~ tr/()/[]/;
        $m=0;
        map { $m += m($p) } @d;
        print "Case ".++$c.": $m\n";

}


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.