September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
6
Task/Logical-operations/BASIC/logical-operations-1.basic
Normal file
6
Task/Logical-operations/BASIC/logical-operations-1.basic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
10 A = -1
|
||||
20 B = 0
|
||||
30 PRINT A AND B
|
||||
40 PRINT A OR B
|
||||
50 PRINT (A AND (NOT B)) OR ((NOT A) AND B)
|
||||
60 PRINT NOT A
|
||||
6
Task/Logical-operations/BASIC/logical-operations-2.basic
Normal file
6
Task/Logical-operations/BASIC/logical-operations-2.basic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
a = true
|
||||
b = false
|
||||
print a and b
|
||||
print a or b
|
||||
print a xor b
|
||||
print not a
|
||||
13
Task/Logical-operations/BASIC/logical-operations-3.basic
Normal file
13
Task/Logical-operations/BASIC/logical-operations-3.basic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
PROClogic(FALSE, FALSE)
|
||||
PROClogic(FALSE, TRUE)
|
||||
PROClogic(TRUE, FALSE)
|
||||
PROClogic(TRUE, TRUE)
|
||||
END
|
||||
|
||||
DEF PROClogic(a%, b%)
|
||||
LOCAL @% : @% = 2 : REM Column width
|
||||
PRINT a% " AND " b% " = " a% AND b% TAB(20);
|
||||
PRINT a% " OR " b% " = " a% OR b% TAB(40);
|
||||
PRINT a% " EOR " b% " = " a% EOR b% TAB(60);
|
||||
PRINT " NOT " a% " = " NOT a%
|
||||
ENDPROC
|
||||
27
Task/Logical-operations/BASIC/logical-operations-5.basic
Normal file
27
Task/Logical-operations/BASIC/logical-operations-5.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Sub logicalDemo(b1 As Boolean, b2 As Boolean)
|
||||
Print "b1 = "; b1
|
||||
Print "b2 = "; b2
|
||||
Print "b1 And b2 = "; b1 And b2
|
||||
Print "b1 Or b2 = "; b1 Or b2
|
||||
Print "b1 XOr b2 = "; b1 Xor b2
|
||||
Print "b1 Eqv b2 = "; b1 Eqv b2
|
||||
Print "b1 Imp b2 = "; b1 Imp b2
|
||||
Print "Not b1 = "; Not b1
|
||||
Print "b1 AndAlso b2 = "; b1 AndAlso b2
|
||||
Print "b1 OrElse b2 = "; b1 OrElse b2
|
||||
Print
|
||||
End Sub
|
||||
|
||||
Dim b1 As Boolean = True
|
||||
Dim b2 As Boolean = True
|
||||
logicalDemo b1, b2
|
||||
b2 = False
|
||||
logicalDemo b1, b2
|
||||
b1 = False
|
||||
logicalDemo b1, b2
|
||||
b2 = True
|
||||
logicalDemo b1, b2
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue