Here’s a little exercise with a violent setting. It might be worth remembering if you’re unfortunate enough to be in a situation like this:
A masked man puts two bullets into adjacent chambers of a six shooter revolver. The masked man aims the gun at you and pulls the trigger.
The chamber advances by one and the masked man prepares to fire once again. He offers you the opportunity to roll the barrel before firing again. Should you take the masked man up on his offer?
Assume you survive the second shot at this point.
Now suppose he is to fire two more times for a total of four shots.
Do you accept a spin of the chamber prior to third shot?
How about a spin of the chamber prior to the fourth?
What are your chances of survival after surviving the first shot?
I want to direct your attention to March’s Agile Staffordshire group. This month we are getting together to cut code and talk about it! If that sounds like your thing, take a look at the March blog post for more details.
Here is a little kata idea courtesy of Rob Stothard, contributor at Agile Staffordshire.
159 * 48 = 7632
includes all the digits from 1 to 9. Find all the other simple multiplications that utilise all nine digits.
This problem poses some interesting challenges. How will you ensure that your testing covers all possibilities?
I am going to use another kata from Dave Thomas’ Blog again! Anagrams!
The challenge is fairly simple: given a file containing one word per line, print out all the combinations of words that are anagrams; each line in the output contains all the words from the input that are anagrams of each other. For example, your program might include in its output:
enlist inlets listen silent
boaster boaters borates
Use the word List for comparing results.