Skip to content


Subversion checkout URL

You can clone with
Download ZIP
phpperu hackingday's exercise #1
PHP Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

hacking exercise PHP Peru

Initial Spec

  1. a player can take a field if not already taken
  2. players take turns taking fields until the game is over
  3. a game is over when all fields are taken
  4. a game is over when all fields in a column are taken by a player
  5. a game is over when all fields in a row are taken by a player
  6. a game is over when all fields in a diagonal are taken by a player


Current Effort

we are trying to lay out the problem in the best way so it will be expandable later on. The first approach now is to identify first the process backbone of the game, then apply events to expand it and perhaps other patterns such as workflow pattern.

So far we have split into several files already the existent code which is best for organization. And we have already used the help initial TDD provided. We will comply with the feature context scenarios however the development now has gone beyond this point so we are not limited by the scope of TDD.


git clone tictactoe
cd tictactoe
php composer.phar install


  • use events for turnSwitcher
  • use validatorBoard for AI insertion
  • board class has non-fixed dimensions
  • validatePosition fetch field from global sack and if it returns null it means it's owned by someone else already
  • SPL reuse for adding players
  • SPL reuse for polling global and player sacks


IRC channel: #phpperu on


PHPPeru is now a github organization

Something went wrong with that request. Please try again.