Results 1 to 3 of 3

Thread: PixelShift

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default PixelShift

    Nevermind, figured it out
    Last edited by Footy; 07-26-2012 at 06:52 PM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    That's because you haven't understood the binary-OR operator.. aka Logical-OR. If you don't understand it, I'm almost certain you will use Logical-AND/XOR wrong as well as they are both used the same way.

    You can't do: 5 or 10 or 15 or 20
    if you do, the result will be 31.

    5 or 10 or 15 or 20 = 31.

    You have to do:
    Simba Code:
    if ((counter = 5) or (counter = 10) or (counter = 15) or (counter = 20)) then..

    You do not need the extra brackets but it's there for distinguishing ambiguity.. The above is the same as:

    Simba Code:
    if (counter = 5 or counter = 10 or counter = 15 or counter = 20) then..

    but I have high standards and the brackets make it easier to read so I recommend using them.
    Last edited by Brandon; 07-26-2012 at 07:00 PM.
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is my first programming language, so I had no idea that equaled 31... Ill use your way instead, thanks!
    E: got a type mismatch error when I tried it...
    E: typed it like this to get it working
    Simba Code:
    if (counter = 5) or (counter = 10) or (counter = 15) or (counter = 20) then
    Last edited by Footy; 07-26-2012 at 08:51 PM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •