# TDD Kata (6): Bulleyes

At Google Code Jam, Round 1A, I found this problem:

The bull eyes problem: Mary should paint a series of concentric circle, given a radius and an initial amount of paint. The problem is: given r and t (the radius and the amount of paint) how many circles of width 1cm Mary can pain?

I wrote my solution using TDD, but after a first thoughts, I coded a solution using a formula, see:

https://github.com/ajlopez/TddOnTheRocks/tree/master/Bulleyes

The commit history at:

https://github.com/ajlopez/TddOnTheRocks/commits/master/Bulleyes

At the beginning, I had an algorithm that depended on a function that calculates the amount of paint needed to paint a circle of radius r. But then, I replaced it by other algorithm, that directly returns the count of circles that Mary can pain, given an initial radius and paint quantity. All my tests continued to be in green.

As in other Google Code Jam problems, I didn’t write the console program using TDD. I put my focus on the right algorithm. In this case, it was enough to have a general formula that solves the problem.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com

## 6 thoughts on “TDD Kata (6): Bulleyes”

First of all I want to say excellent blog! I had a quick question in which I’d like to ask if you don’t mind.
I was interested to find out how you center yourself and clear
your mind prior to writing. I have had difficulty clearing my thoughts in getting my thoughts out there.
I truly do enjoy writing however it just seems like the first
10 to 15 minutes are wasted simply just trying to figure
out how to begin. Any recommendations or tips?
Thank you!

2. learn Spanish fast yahoo free kids game

Write more, thats all I have to say. Literally, itt sedems as though you relied on the
video to make your point. You definitely know wha youre talking about, why throw away your intelligence on just posting
videos to your weblog when you could bbe giving us something informative to read?

3. ios

Ahaa, its nice conversation regarding this article at this place at this blog, I
have read all that, so at this time me also commenting here.