Boolean values: Difference between revisions
→{{header|MiniScript}}: extended example
(→{{header|MiniScript}}: extended example) |
|||
Line 1,259:
=={{header|MiniScript}}==
In MiniScript, numbers represent boolean values, with additional fuzzy logic for degrees of truth. Built-in constants `true` and `false` are simply aliases for 1 and 0, respectively.
<lang MiniScript>boolTrue =
boolFalse =
if boolTrue then print "boolTrue is true, and its value is: " + boolTrue
if not boolFalse then print "boolFalse is not true, and its value is: " + boolFalse
mostlyTrue = 0.8
kindaTrue = 0.4
print "mostlyTrue AND kindaTrue: " + (mostlyTrue and kindaTrue)
print "mostlyTrue OR kindaTrue: " + (mostlyTrue or kindaTrue)</lang>
{{out}}
<pre>boolTrue is true, and its value is: 1
boolFalse is not true, and its value is: 0
mostlyTrue AND kindaTrue: 0.32
mostlyTrue OR kindaTrue: 0.88</pre>
=={{header|Mirah}}==
|