1. sanaranjo's Avatar
    This is my first time every playing in Swift Playground. Total coding newbie. As I started playing in the playground, I just couldn't stop. These puzzles are really fun. Although this one command in particular is kicking my butt. Here is the command:

    Code:
    while !isBlocked && !isOnClosedSwitch || !isOnOpenSwitch {
        moveForward()
    }
    And here is a screenshot.

    For me, this says "as long as the path is not blocked AND is not sitting on an open or closed switch", then the statement would be true. However, the character just keeps walking through this command. Here is a screencast:

    https://www.screencast.com/t/5QJXBl71

    Right at 30 seconds, the little character continues to walk forward. But why? Since the character is sitting on a closed switch, shouldn't the character stop?

    Doesn't "!isOnClosedSwitch" = is not on a closed switch?

    Please help.
    06-24-2020 08:34 PM
  2. Just_Me_D's Avatar
    Hopefully someone will be along to assist you soon.
    06-25-2020 07:53 PM

Similar Threads

  1. Apple Privacy in 2020: Why you'll want these feature right now
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 06-24-2020, 04:12 PM
  2. Apple is closing its retail stores in Texas again as COVID-19 cases rise
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 06-24-2020, 02:51 PM
  3. Become a data master with this in-depth Excel training
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 06-24-2020, 01:12 PM
  4. Rumored 20W iPhone 12 charger spotted in certifications
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 06-24-2020, 11:12 AM
  5. DOJ 'taking the first steps towards' Apple antitrust probe in the U.S.
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 06-24-2020, 10:30 AM
LINK TO POST COPIED TO CLIPBOARD