Tuesday, March 29, 2011

01 Kata [reason] - sum of multiples of 3 or 5 less than 1000

The purpose of this first kata is to solve a small problem from Project Euler site in the following programming languages: Java, Scala, Ruby and Haskell.
Also, we should provide different solution within a given language.

Why is that?
Well, the main goal here is:
  • to practice in different languages in order to see the problem from different perspectives
  • when trying to find different solutions for the same problem within a give language we are forced to deep our knowledge of that given language.

I will split the solutions in various posts separated by languages to make it easier to follow.

So, let's get things done here.

The codes are available at github.
git://github.com/colt44/kata-coder.git

The problem:
Find the sum of all numbers multiple of 3 or 5 less than 1000

The enviroment
Java
openjdk 64 bits - version "1.6.0_18"
testNG - version 5.6
ruby - version 1.8
haskell - version 6.12.1