Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Problem with And & or

    Help
    2
    2
    181
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • une_tortue
      une_tortue last edited by

      Here is a program that comes from tutorial 9:

      Loop
               Clear()
      
               j = controls( 0 )
      
               if !j.zl and !j.zr then
                      Print( "Hurray!" )
                endif
      
                 update()
      repeat
      

      With this program the 'and' operator acts as the 'or' operator and vice versa
      is this normal ?

      1 Reply Last reply Reply Quote 0
      • pianofire
        pianofire Fuze Team last edited by pianofire

        In the above it only displays "Hurray!" when zl is NOT pressed (! operator) AND zr is NOT pressed.

        So if zr is pressed or zl is pressed (or both are pressed) it is not displayed

        NotAandNotB.png

        1 Reply Last reply Reply Quote 2
        • First post
          Last post