Author Topic: Implied  (Read 8080 times)

0 Members and 1 Guest are viewing this topic.

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Implied
« Reply #30 on: August 29, 2020, 11:35:46 am »
Basically it's a shortcut for:

IF NOT (condition1 AND NOT condition2) THEN...
Or even just IF NOT condition1 OR condition2 THEN :)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Implied
« Reply #31 on: August 29, 2020, 12:01:37 pm »
Quote
And NOT A could be in B or NOT(in NOT B) ???

Well NOT (NOT B) gets us back to B again ;-))

Just saying if A implies B in Venn diagram then A must be a subset of B.
« Last Edit: August 29, 2020, 12:05:19 pm by bplus »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Implied
« Reply #32 on: August 29, 2020, 12:05:09 pm »
Or even just IF NOT condition1 OR condition2 THEN :)

Good catch.  Your syntax is probably one we'd actually see more often than mine would be.  :D
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: Implied
« Reply #33 on: August 29, 2020, 01:34:10 pm »
Ya Luke that was one expression I was about to explore and it works. Here's Steve test with your syntax

Code: QB64: [Select]
  1. INPUT "ARE YOU LIVING (-1 FOR YES, 0 FOR NO)"; living
  2. INPUT "ARE YOU DEAD (-1 FOR YES, 0 FOR NO)"; dead
  3. Result = NOT (living) OR dead
  4. IF Result = 0 THEN
  5.     PRINT "YOU ARE A SENTIENT CREATURE"
  6.     PRINT "YOU ARE SOMETHING NON-SENTIENT."