Jump to content

Template:Truth table auto: Difference between revisions

From Logic World Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 21: Line 21:
"expr1": {
"expr1": {
"description": "Expression for output #1",
"description": "Expression for output #1",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
},
},
"expr2": {
"expr2": {
"description": "Expression for output #2",
"description": "Expression for output #2",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
},
},
"expr3": {
"expr3": {
"description": "Expression for output #3",
"description": "Expression for output #3",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
},
},
"expr4": {
"expr4": {
"description": "Expression for output #4",
"description": "Expression for output #4",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
},
},
"expr5": {
"expr5": {
"description": "Expression for output #5",
"description": "Expression for output #5",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
},
},
"expr6": {
"expr6": {
"description": "Expression for output #6",
"description": "Expression for output #6",
"example": "(a & b) | c ^ d",
"example": "(a & b) + c ^ d",
"type": "line"
"type": "line"
}
}
},
},
"description": "Renders a truth table with any number of inputs and outputs",
"description": "Renders a truth table with any number of inputs and outputs.\n\nIMPORTANT: Make sure to use \"+\" instead of \"|\" as the OR operator. Wikitest parses the \"|\" as a property separator unless you instead use \"{{!}}\", but the plus sign is better for readability.",
"paramOrder": [
"paramOrder": [
"caption",
"caption",
Line 65: Line 65:
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude><includeonly>{{#invoke:LogicUtils|truth_table_auto}}</includeonly>
<includeonly>{{#invoke:LogicUtils|truth_table_auto}}</includeonly>

Latest revision as of 19:00, 9 September 2025

Renders a truth table with any number of inputs and outputs. IMPORTANT: Make sure to use "+" instead of "|" as the OR operator. Wikitest parses the "|" as a property separator unless you instead use "{{!}}", but the plus sign is better for readability.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
captioncaption

Title to show above the table

Lineoptional
inputsinputs

Number of inputs or list of input names

Example
"3", "A B C"
Linerequired
outputsoutputs

Number of outputs or list of output names

Example
"2", "X Y"
Linerequired
expr1expr1

Expression for output #1

Example
(a & b) + c ^ d
Lineoptional
expr2expr2

Expression for output #2

Example
(a & b) + c ^ d
Lineoptional
expr3expr3

Expression for output #3

Example
(a & b) + c ^ d
Lineoptional
expr4expr4

Expression for output #4

Example
(a & b) + c ^ d
Lineoptional
expr5expr5

Expression for output #5

Example
(a & b) + c ^ d
Lineoptional
expr6expr6

Expression for output #6

Example
(a & b) + c ^ d
Lineoptional