advertisement

Article:
  Building a Game Engine with Cocoa, Part 2
Subject:   Incorrect Boolean login in NOTEQUAL_NSPOINTS?
Date:   2007-01-06 07:15:35
From:   ptwobrussell
Response to: Incorrect Boolean login in NOTEQUAL_NSPOINTS?

Joe, That's a great catch. According to DeMorgan's law, you're absolutely correct. The reason this typo (from where I'd cut/pasted the previous macro) didn't surface in the execution of the program as presented is that in all cases valid NSPoints were being compared to NIL_POINT. Thus, the sub-expressions always evaluate to NO. i.e. (NO && NO == NO) and (NO || NO == NO) and it didn't make a difference as far as the end result was concerned. When you compare a valid point to another valid point, however, there would have certainly been a noticeable bug in place.


Anyway, we'll have the article and project files updated shortly, along with one other small change to the opponentInLineBetweenCoord:andCoord: method . Thanks for pointing that out!


1 to 1 of 1
  1. Matthew Russell photo FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
    2007-01-08 08:43:30  Matthew Russell | O'Reilly AuthorO'Reilly Blogger [View]

    • FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
      2007-01-12 06:52:49  wootest [View]

      • Matthew Russell photo FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
        2007-01-12 17:09:37  Matthew Russell | O'Reilly AuthorO'Reilly Blogger [View]

        • Matthew Russell photo FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
          2007-01-15 11:23:07  Matthew Russell | O'Reilly AuthorO'Reilly Blogger [View]

        • FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
          2007-01-15 09:55:49  Ginkgo_52 [View]

1 to 1 of 1