Tic-Tac-Toe

From BP Wiki
Revision as of 07:35, 7 April 2014 by Assaf (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A behavioral program for the game of Tic-Tac-Toe

  • Download the example from LINK

b-Threads

Rules of the game

  • SquareTaken: block further marking of a square already marked by X or O.
  • EnforceTurns: alternately block O moves while waiting for X moves, and vice versa (we assume that X always plays first).
  • DetectXWin: wait for placement of three X marks in a line and request XWin.
  • DetectOWin: wait for placement of three O marks in a line and request OWin.
  • DetectDraw: wait for nine moves and request draw event.

Strategies