Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Test-Driven Java Development

You're reading from   Test-Driven Java Development Invoke TDD principles for end-to-end application development with Java

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781783987429
Length 284 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Why Should I Care for Test-driven Development? FREE CHAPTER 2. Tools, Frameworks, and Environments 3. Red-Green-Refactor – from Failure through Success until Perfection 4. Unit Testing – Focusing on What You Do and Not on What Has Been Done 5. Design – If It's Not Testable, It's Not Designed Well 6. Mocking – Removing External Dependencies 7. BDD – Working Together with the Whole Team 8. Refactoring Legacy Code – Making it Young Again 9. Feature Toggles – Deploying Partially Done Features to Production 10. Putting It All Together Index

Connect4


Connect4 is a popular, very easy-to-play board game. The rules are limited and simple.

Note

Connect4 is a two-player connection game, in which the players first choose a color and then take turns dropping colored discs from the top into a seven-column, six-row, vertically suspended grid. The pieces fall straight down, occupying the next available space within the column. The objective of the game is to connect four of one's own discs of the same color next to each other vertically, horizontally, or diagonally, before your opponent connects four of theirs.

For further information on the game, visit Wikipedia (http://en.wikipedia.org/wiki/Connect_Four).

Requirements

In order to code the two implementations of Connect4, the game rules are transcribed below in the form of requirements. These requirements are the starting point for both the developments. We will go through the code with some explanations and compare both implementations at the end:

  1. The board is composed of seven columns and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime