September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View 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"

View 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

View file

@ -0,0 +1,5 @@
TYPE MIXED
LOGICAL*1 LIVE
REAL*8 VALUE
END TYPE MIXED
TYPE(MIXED) STUFF(100)

View file

@ -0,0 +1,5 @@
TYPE MIXED
LOGICAL*1 LIVE(100)
REAL*8 VALUE(100)
END TYPE MIXED
TYPE(MIXED) STUFF

View file

@ -0,0 +1,8 @@
Public Sub Main()
Dim bX As Boolean
Print bX
bX = True
Print bX
End

View file

@ -0,0 +1,3 @@
a:=True;
b:=False;
True.dir();