Re: VIER/NEUN problem

2001-08-14 Thread John Porter

John Satoshi Beppu wrote:
> How can you be part of the Eric Conspiracy Secret Labs
> if your name is Greg?

I seem to recall (it's been a long time) that there was an
allowance for "honorary" Erics under exceptional circumstances.

-- 
John Porter




Re: VIER/NEUN problem

2001-08-13 Thread Greg Bacon

In message <[EMAIL PROTECTED]>,
John Satoshi Beppu writes:

: How can you be part of the Eric Conspiracy Secret Labs
: if your name is Greg?

No comment.



Re: VIER/NEUN problem

2001-08-13 Thread Craig S. Cottingham

On Monday, August 13, 2001, at 05:39 , John Satoshi Beppu wrote:

> [from your header]
>> Organization: Eric Conspiracy Secret Labs
>
>> Enjoy,
>> Greg
>
> How can you be part of the Eric Conspiracy Secret Labs
> if your name is Greg?

Ah, but that's part of the secret. Or part of the conspiracy; I 
forget which.

--
Craig S. Cottingham
[EMAIL PROTECTED]
PGP key available from: 

ID=0xA2FFBE41, fingerprint=6AA8 2E28 2404 8A95 B8FC 7EFC 136F 
0CEF A2FF BE41



Re: VIER/NEUN problem

2001-08-13 Thread John Satoshi Beppu

[from your header]
> Organization: Eric Conspiracy Secret Labs

> Enjoy,
> Greg

How can you be part of the Eric Conspiracy Secret Labs
if your name is Greg?




VIER/NEUN problem

2001-08-13 Thread Greg Bacon

According to http://members.home.net/js.graham/vierneun.html>:

VIER and NEUN represent 4-digit squares, each letter denoting a
distinct digit. You are asked to find the value of each, given the
further requirement that each uniquely determines the other.

Here's a solution from map/grep Hell:

#! /usr/local/bin/perl -w

    # VIER/NEUN problem

use strict;

use POSIX qw/ ceil floor /;

my $expr = qr/
^

(.) # V
((?!\1) .)  # I
((?!\1|\2)  .)  # E
((?!\1|\2|\3)   .)  # R

((?!\1|\2|\3|\4).)  # N
\3  # E
((?!\1|\2|\3|\4|\5) .)  # U
\5  # N

$
/x;

my $lo = ceil  sqrt 1000;
my $hi = floor sqrt ;

my %seen;

$" = '';
my @list = map  { $_->[0] }
   grep { $_->[1] == 2 }
   map  { [ $_, $seen{$_->[0]} + $seen{$_->[1]} ] }
   grep { ++$seen{$_->[0]} && ++$seen{$_->[1]} }
   grep { "@{$_}[0,1]" =~ /$expr/ }
   map  { $% = $_;  map { [ $_ * $_, $% ] } $lo .. $hi }
   grep { /^(.)..\1$/ }
   map  { $_ * $_ }
   $lo .. $hi;

if (@list != 1) {
$_ = @list;
warn "$0: expected one result, got $_:\n";

for (@list) {
print "VIER = $_->[0], NEUN = $_->[1]\n";
}
}

my($soln) = @list;
print "VIER = $soln->[0], NEUN = $soln->[1]\n";

Enjoy,
Greg