[Wellington-pm] SEND + MORE = MONEY

Ewen McNeill ewen at naos.co.nz
Wed Mar 2 20:55:15 PST 2005

In message <422694C1.7010600 at vilain.net>, Sam Vilain writes:
>    use Quantum::Superpositions;
>    $\="\n";
>    my $a = any(1,0);
>    print ($a + $a == 1);  # prints 1, actually impossible
>    print (2 * $a == 1);   # prints any() (ie, none)

$a + $a == 1  is possible if the first $a is taken as 1, and the second
$a is taken as 0 (or vice versa).  Where as there is no value in $a
which can be multiplied by 2 and yeild 1 (you get 2 or 0).

Seems to me that it's working the way that it should there.

So your solution using Quantum::Superpositions may well work.  Just be
prepared for it to take a while.  (Some of my early test runs of my
brute force method took around 12 minutes; a bit of tuning got that down
to the 4 minutes something that I posted.)


More information about the Wellington-pm mailing list