Binary Blunders Practice: Advanced

Here be the advanced binary blunders practice, where the code be messy and confusing.

Use these blunders to improve your binary fu:

Example 1: Buggy Conditional Statements

      
        if (a == 5) {
          console.log("a is 5, but it's actually 6");
        } else {
          console.log("a is not 5, but it's actually 6");
        }
      
    

This conditional statement will print the opposite of what it's expecting. Try fixing it!

Example 2: Overly Complex Logic

      
        var x = 1;
        if (x > 5) {
          if (x < 10) {
            console.log("x is between 5 and 10");
          } else {
            console.log("x is over 10");
          }
        } else {
          console.log("x is not over 5");
        }
      
    

This logic will print the wrong output. Try simplifying it!

Example 3: Obfuscated Binary Code

      
        // 10 PRINT "HELLO, WORLD"
        // 20 GOTO 30
        // 30 PRINT 42
        // 40 GOTO 10
      
    

Unobfuscate this binary code. Good luck!

Want more binary blunders? Check out Advanced Binary Blunders

Or, if you're feeling extra brave, try Very Advanced Binary Blunders

Remember, the more you practice, the more you will not understand what's going on.