Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Generate a truth table from input string

by Anonymous Monk
on May 14, 2008 at 11:29 UTC ( #686495=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #my $bool_func = "((S0'*B)|((!S0)|A))'";
    my $bool_func = "(a'+b'+c')";
    ...
        my $result = eval $perl_expr & 1;
    print join(",    ", map { "$val{$_}" }keys %val),"  =$result\n";
    }
    
  2. or download this
    equivalent expression: (~a|~b|~c)
    c,      b,      a,      out
    ...
    1,      1,      0       = 1
    1,      0,      1       = 1
    1,      1,      1       = 0
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-06-19 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (92 votes). Check out past polls.

    Notices?