Book Image

Test-Driven Java Development

Book Image

Test-Driven Java Development

Overview of this book

Table of Contents (17 chapters)
Test-Driven Java Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
8
Refactoring Legacy Code – Making it Young Again
Index

More exercises


We just developed one (most commonly used) variation of the Tic-Tac-Toe game. As an additional exercise, pick one or more variations from Wikipedia (http://en.wikipedia.org/wiki/Tic-tac-toe) and implement it using the red-green-refactor procedure. When finished, implement a kind of AI that would play O's turns. Since Tic-Tac-Toe usually leads to a draw, AI can be considered finished when it successfully reaches a draw for any combination of X's moves.

While working on those exercises, remember to be fast and play ping pong. Also, most of all, remember to use the red-green-refactor procedure.