I came across this truth table generation site and tried to simulate it in PHP (I understand that the source code is available, but I know 0 perl).
Now my question is not in evaluating the expression, but in how to display the table so that each combination of T and F for the variables is displayed
For example, with three variables, the table would look like this:
a | b | c ----------- T | T | TT | T | FT | F | TT | F | FF | T | TF | T | FF | F | TF | F | F
and with 4 variables.
a | b | c | d ------------- T | T | T | T T | T | T | F T | T | F | T T | T | F | F T | F | T | T T | F | T | F T | F | F | T T | F | F | F F | T | T | T F | T | T | F F | T | F | T F | T | F | F F | F | T | T F | F | T | F F | F | F | T F | F | F | F
What is the logic / pattern for creating it?
sqram source share