07-27-2022, 07:27 PM
To explain the above, let me break down and simplify the logic for you guys.
Remember A IMP B is the *exact* same thing as NOT A OR B. I'm going to expand this equivalent expression, as everyone has a better grasp on the NOT and OR commands.
Logically speaking, NOT A OR B is basically a truth check to see if either of our two conditions are TRUE, and if so, then we count the statement as TRUE. It's basically IF (NOT A) OR (B) THEN.... <-- I would hope it's easy enough to see the 2 conditions we're checking here.
B .... would be TRUE, as long as it's not 0. That's the basic truth of BASIC -- anything non-zero is counted as TRUE. With (Whatever) OR B, as long as B is TRUE, we evaluate the whole statement as TRUE. B **has** to be zero for the statement to ever be FALSE.
IF B <> 0 THEN the statement is true, regardless of whatever the left side of the statement is. We're checking OR B after all.
For the left side, we're evaluating NOT A. Again, *any* non-zero number would be TRUE. Knowing that, what's the *ONLY* value NOT A can be to become 0??
-1!!
NOT -1 = 0. Every other value equals something else. *ONLY* when A is -1, do we have a FALSE statement of the left side of that OR operator. Any other value is TRUE.
Which brings us to this simple conclusion:
IF A = -1 AND B = 0 THEN
we have a FALSE result
ELSE
everything else is TRUE
END IF
So A = 10... TRUE! Who cares what B is! I can assure you, it's TRUE just from the A side of things...
B = 10? That's got to be TRUE. Doesn't matter what A is, the B side alone defines it as TRUE.
The **ONLY** way you get FALSE is when A = -1 AND B = 0. Any other values than those two and you get TRUE.
Remember A IMP B is the *exact* same thing as NOT A OR B. I'm going to expand this equivalent expression, as everyone has a better grasp on the NOT and OR commands.
Logically speaking, NOT A OR B is basically a truth check to see if either of our two conditions are TRUE, and if so, then we count the statement as TRUE. It's basically IF (NOT A) OR (B) THEN.... <-- I would hope it's easy enough to see the 2 conditions we're checking here.
B .... would be TRUE, as long as it's not 0. That's the basic truth of BASIC -- anything non-zero is counted as TRUE. With (Whatever) OR B, as long as B is TRUE, we evaluate the whole statement as TRUE. B **has** to be zero for the statement to ever be FALSE.
IF B <> 0 THEN the statement is true, regardless of whatever the left side of the statement is. We're checking OR B after all.
For the left side, we're evaluating NOT A. Again, *any* non-zero number would be TRUE. Knowing that, what's the *ONLY* value NOT A can be to become 0??
-1!!
NOT -1 = 0. Every other value equals something else. *ONLY* when A is -1, do we have a FALSE statement of the left side of that OR operator. Any other value is TRUE.
Which brings us to this simple conclusion:
IF A = -1 AND B = 0 THEN
we have a FALSE result
ELSE
everything else is TRUE
END IF
So A = 10... TRUE! Who cares what B is! I can assure you, it's TRUE just from the A side of things...
B = 10? That's got to be TRUE. Doesn't matter what A is, the B side alone defines it as TRUE.
The **ONLY** way you get FALSE is when A = -1 AND B = 0. Any other values than those two and you get TRUE.