First, apologies for nodding off and not posting for the last few weeks. I have the usual set of excuses, which you can guess easily enough without the need to read them here. So, on to the kata: something a bit different, this time. It’s a repeat of a kata we had a go... Read more
The kata Following on from last time, this is based on Uncle Bob’s now-famous bowling game kata, with the added spice of adhering to the open-closed principle of SOLID. The kata is well-documented online, but briefly, the idea is to write a program that takes in a series of scores for each ball a... Read more
The kata Let’s get this clear: we’re not going to write a chess-playing AI in this kata. The idea is a bit more humble: to write a program that can work out valid moves for a set of chess pieces. The purpose of this kata is to practise writing SOLID code. Use TDD, but... Read more
Naming things can be very hard, yet a well-chosen name can really help a reader understand how your code works. This code kata is an old favorite, one that we’ve done before, but this time we’ve added an emphasis on naming things well. The kata A word ladder is a sequence of words (each... Read more
The kata This kata was inspired by a truly ugly piece of code we came across in Redgate Towers. It had a whole bouquet of code smells: long methods, a lot of indentation, static variables, inconsistent naming, code that was duplicated with small modifications, and a couple of small bugs. And, gloriously, it was... Read more
The kata You are given a program which is capable of traversing 2D mazes. However, the solution isn’t perfect and fails to find the exit in certain types of mazes. Moreover, the current solution is messy, doesn’t follow any sensible coding principles (e.g. SOLID) and is completely untested. The input to the program is... Read more
The kata Imagine: it’s 1968 – the Beatles, Carnaby St and Austin Powers – except there’s all the technology of 2013 as well. Including vending machines. But, being 1968, vending machines have to deal with old money. It’s quite simple; I’ll describe it here. Money is made up of pounds (£), shillings (s) and... Read more