September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
8
Task/Boolean-values/BASIC/boolean-values-2.basic
Normal file
8
Task/Boolean-values/BASIC/boolean-values-2.basic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
' Boolean TRUE and FALSE are non-zero and zero constants
|
||||
a = TRUE
|
||||
b = FALSE
|
||||
PRINT a, ", ", b
|
||||
|
||||
IF 0 THEN PRINT "TRUE" : ELSE PRINT "FALSE"
|
||||
IF 1 THEN PRINT "TRUE"
|
||||
IF 2 THEN PRINT "TRUE"
|
||||
44
Task/Boolean-values/Elm/boolean-values.elm
Normal file
44
Task/Boolean-values/Elm/boolean-values.elm
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
--True and False directly represent Boolean values in Elm
|
||||
--For eg to show yes for true and no for false
|
||||
if True then "yes" else "no"
|
||||
|
||||
--Same expression differently
|
||||
if False then "no" else "yes"
|
||||
|
||||
--This you can run as a program
|
||||
--Elm allows you to take anything you want for representation
|
||||
--In the program we take T for true F for false
|
||||
import Html exposing(text,div,Html)
|
||||
import Html.Attributes exposing(style)
|
||||
|
||||
type Expr = T | F | And Expr Expr | Or Expr Expr | Not Expr
|
||||
|
||||
evaluate : Expr->Bool
|
||||
evaluate expression =
|
||||
case expression of
|
||||
T ->
|
||||
True
|
||||
|
||||
F ->
|
||||
False
|
||||
|
||||
And expr1 expr2 ->
|
||||
evaluate expr1 && evaluate expr2
|
||||
|
||||
Or expr1 expr2 ->
|
||||
evaluate expr1 || evaluate expr2
|
||||
|
||||
Not expr ->
|
||||
not (evaluate expr)
|
||||
|
||||
--CHECKING RANDOM LOGICAL EXPRESSIONS
|
||||
ex1= Not F
|
||||
ex2= And T F
|
||||
ex3= And (Not(Or T F)) T
|
||||
|
||||
main =
|
||||
div [] (List.map display [ex1, ex2, ex3])
|
||||
|
||||
display expr=
|
||||
div [] [ text ( toString expr ++ "-->" ++ toString(evaluate expr) ) ]
|
||||
--END
|
||||
5
Task/Boolean-values/Fortran/boolean-values-1.f
Normal file
5
Task/Boolean-values/Fortran/boolean-values-1.f
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
TYPE MIXED
|
||||
LOGICAL*1 LIVE
|
||||
REAL*8 VALUE
|
||||
END TYPE MIXED
|
||||
TYPE(MIXED) STUFF(100)
|
||||
5
Task/Boolean-values/Fortran/boolean-values-2.f
Normal file
5
Task/Boolean-values/Fortran/boolean-values-2.f
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
TYPE MIXED
|
||||
LOGICAL*1 LIVE(100)
|
||||
REAL*8 VALUE(100)
|
||||
END TYPE MIXED
|
||||
TYPE(MIXED) STUFF
|
||||
8
Task/Boolean-values/Gambas/boolean-values.gambas
Normal file
8
Task/Boolean-values/Gambas/boolean-values.gambas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Public Sub Main()
|
||||
Dim bX As Boolean
|
||||
|
||||
Print bX
|
||||
bX = True
|
||||
Print bX
|
||||
|
||||
End
|
||||
3
Task/Boolean-values/Zkl/boolean-values.zkl
Normal file
3
Task/Boolean-values/Zkl/boolean-values.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
a:=True;
|
||||
b:=False;
|
||||
True.dir();
|
||||
Loading…
Add table
Add a link
Reference in a new issue