Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: TIMTOWTDI and other languages

by jynx (Priest)
on Apr 28, 2002 at 21:42 UTC ( [id://162715]=note: print w/replies, xml ) Need Help??


in reply to TIMTOWTDI and other languages

Warning: untested code ahead!
Quantum::Superpositions :)
use Quantum::Superpositions; my @alphas = qw/ 9 4 3 2 22 13 7 140 95 278/; my @betas = qw/ 8 3 4 1 278 94 15 7 19 200/; my @results; for my $element (@alphas) { if ($element == any(@betas)) { push @results, $element; } } print "Results: ", (sort{ $a <=> $b }@results), "\n";
jynx

Replies are listed 'Best First'.
Re: Re: TIMTOWTDI and other languages
by TheDamian (Vicar) on Apr 30, 2002 at 03:57 UTC
    ...or, even easier:
    use Quantum::Superpositions; my @alphas = qw/ 9 4 3 2 22 13 7 140 95 278/; my @betas = qw/ 8 3 4 1 278 94 15 7 19 200/; my @results = eigenstates( any(@alphas) == any(@betas) );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://162715]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found