• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Using Operators > Flash at Work: Applying Bitwise Operators to Tic-...

Flash at Work: Applying Bitwise Operators to Tic-Tac-Toe

Bitwise operators can make a difference in speed in a tic-tac-toe game because they can be used for repeated operations.

At the very least, you need to check once for each of the winning patterns each time a player makes a move, to determine whether the player has just created a winning pattern. If you want the computer to play an intelligent game, you also need to determine whether the player will be able to create one of these patterns in the next move. Bitwise operators allow you to make these calculations very quickly.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint