Documenting and Testing Your Game

You have a working game at this point, but you also need to consider the poor developer who’s going to pick this up six months from now (particularly if it’s you). You worked hard to pick a good data structure and implement your functions, but you need to communicate those data structures for future use.

If you write some specs, you can describe the key data structures, annotate the functions, and even generate some automated tests that check whether everything works (especially when you start making changes at some future date).

When you started working on the implementation earlier, we quickly honed in on the progress data structure and the trio of internal functions (new-progress, update-progress, and complete? ...

Get Programming Clojure, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.