Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: TIMTOWTDI and other languages

by jynx (Priest)
on Apr 28, 2002 at 21:42 UTC ( #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


Comment on Re: TIMTOWTDI and other languages
Download Code
Replies are listed 'Best First'.
Re: Re: TIMTOWTDI and other languages
by TheDamian (Priest) 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
Node Status?
node history
Node Type: note [id://162715]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2015-07-31 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (281 votes), past polls