Jump to content

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 = 1true
boolFalse = 0false
 
if boolTrue then print "boolTrue is true, and its value is: " + boolTrue
print "Its's true!"
end if
 
if not boolFalse then print "boolFalse is not true, and its value is: " + boolFalse
 
print "It's not true!"
mostlyTrue = 0.8
end if</lang>
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}}==
222

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.