Skip to content
Kata del mes de Enero del 2011: String Calculator
PHP Java Ruby Python C# Groovy Other
Latest commit 45d39cd Apr 8, 2012 @12meses12katas Merge pull request #106 from jesantana/master
kata enero
Failed to load latest commit information.
Aitortxu Fix repo Apr 16, 2011
Arween17 Kata StringCalculator en Java Jun 2, 2011
Capelare Updated test.c for the next step of the exercise. May 29, 2011
GerardoGomez Primer paso terminado Apr 25, 2011
JNavas/StringCalculator Proyect de Joan Navarrete Sanchez Mar 27, 2012
MuDestructor Fix repo Apr 16, 2011
Sivainvi Fix repo Apr 16, 2011
VictorVelarde Inicio del kata... Apr 25, 2011
aabilio/bash/src Fix repo Apr 16, 2011
agileando Fix repo Apr 16, 2011
agutierrez Fix repo Apr 16, 2011
alejandrogomez refactorizar add() May 10, 2011
alex952 Fix repo Apr 16, 2011
alonsogarciapablo Fix repo Apr 16, 2011
amaneiro Fix repo Apr 16, 2011
amedio Test con saltos de lineas Oct 17, 2011
amuino Fix repo Apr 16, 2011
animalaes Fix repo Apr 16, 2011
armenta-angel/src fuera ficheros eclipse Aug 19, 2011
arturoherrero Fix repo Apr 16, 2011
calavera/ruby Fix repo Apr 16, 2011
cavalle Fix repo Apr 16, 2011
cchau Added a Calculator Kata written in C Apr 16, 2011
cibernox my first kata. It was fun! Jul 14, 2011
darkturo Ended. Tookme 5 minutes more to finish this because of debbuging :-/ Jun 6, 2011
davamix Fix repo Apr 16, 2011
deadsunrise Fix repo Apr 16, 2011
diegoguemes/EneroStringCalculator Separando responsabilidades en StringCalculator Feb 26, 2012
discolo Fix repo Apr 16, 2011
drodriguez Fix repo Apr 16, 2011
eamodeorubio Fix repo Apr 16, 2011
eferro/src Fix repo Apr 16, 2011
ejosafat Fix repo Apr 16, 2011
elmendalerenda Fix repo Apr 16, 2011
enriclluelles ruby implementation Oct 20, 2011
erpheus Fix repo Apr 16, 2011
flype Fix repo Apr 16, 2011
fperezpt Fix repo Apr 16, 2011
gaizka/string_calculator Fix repo Apr 16, 2011
germandz Fix repo Apr 16, 2011
ggalmazor Fix repo Apr 16, 2011
gonzalo123 Fix repo Apr 16, 2011
harad Fix repo Apr 16, 2011
hell03610 Fix repo Apr 16, 2011
hvicente Fix repo Apr 16, 2011
ialcazar Fix repo Apr 16, 2011
ign4ci0 Fix repo Apr 16, 2011
ikercelorrio/java/StringCalculator After Test 5.2 - Brutal Refactor (Brutal?) Yeah! Oct 6, 2011
j0hn Fix repo Apr 16, 2011
jacegu Fix repo Apr 16, 2011
japaz Fix repo Apr 16, 2011
javisantana Fix repo Apr 16, 2011
jbeerdev Fix repo Apr 16, 2011
jesantana/Groovy primer commit a 12meses12katas Nov 26, 2011
jjfalcon Fix repo Apr 16, 2011
jjuarez/ruby Fix repo Apr 16, 2011
jlebrijo StringCalculator Java Kata, con video Oct 10, 2011
jlopez Fix repo Apr 16, 2011
jomarmen Fix repo Apr 16, 2011
joseraya Fix repo Apr 16, 2011
josmas Fix repo Apr 16, 2011
jparcol Fix repo Apr 16, 2011
jrdi Finish ruby version Oct 30, 2011
jsayar/stringcalculator Initial commit for kata of Jesus Sayar Aug 27, 2011
juriarte Fix repo Apr 16, 2011
kinisoftware Fix repo Apr 16, 2011
lantoli get delimiters function improved Apr 25, 2011
luque Fix repo Apr 16, 2011
magmax Fix repo Apr 16, 2011
manute Manute Kata Nov 27, 2011
mariotux Fix repo Apr 16, 2011
mfdez1982 Fix repo Apr 16, 2011
mgryszko Fix repo Apr 16, 2011
miguelerm Fix repo Apr 16, 2011
minayaserrano Kata de Enero StringCalculator en PHP5.3 Sep 23, 2011
montes Fix repo Apr 16, 2011
neodevelop Mi solucion con groovy.. May 10, 2011
penyaskito/php Fix repo Apr 16, 2011
pereta Fix repo Apr 16, 2011
plagelao Fix repo Apr 16, 2011
porras Fix repo Apr 16, 2011
prietopa Enero 12meses12katas Sep 20, 2011
programania Fix repo Apr 16, 2011
rafadc Fix repo Apr 16, 2011
remosu Allow multiple delimiters Apr 30, 2011
rmhdev/php (php) Kata resolved. Cleaning code. Dec 31, 2011
robjperez/StringCalculator Fix repo Apr 16, 2011
rubendelafuente Fix repo Apr 16, 2011
sergiogragera Kata enero: StringCalculator (Java) May 23, 2011
sortega Fix repo Apr 16, 2011
sourcerebels Fix repo Apr 16, 2011
soyangel Fix repo Apr 16, 2011
ssoto Fix repo Apr 16, 2011
txingo Fix repo Apr 16, 2011
xexu Fix repo Apr 16, 2011
yodogi Final del ejercicio May 23, 2011
README Fix repo Apr 16, 2011

README

Instrucciones de la Kata String Calculator (sacadas de la web: http://www.osherove.com/tdd-kata-1/)
------------------------------------------

Before you start:
 
- Try not to read ahead.
- Do one task at a time. The trick is to learn to work incrementally.
- Make sure you only test for correct inputs. there is no need to test for invalid inputs for this kata
 
String Calculator:

1) Create a simple String calculator with a method int Add(string numbers)
    1. The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example “” or “1” or “1,2”
    2. Start with the simplest test case of an empty string and move to 1 and two numbers
    3. Remember to solve things as simply as possible so that you force yourself to write tests you did not think about
    4. Remember to refactor after each passing test
2) Allow the Add method to handle an unknown amount of numbers
3) Allow the Add method to handle new lines between numbers (instead of commas).
    1. the following input is ok:  “1\n2,3”  (will equal 6)
    2. the following input is NOT ok:  “1,\n” (not need to prove it - just clarifying)
4) Support different delimiters
    1. to change a delimiter, the beginning of the string will contain a separate line that looks like this:   “//[delimiter]\n[numbers…]” for example “//;\n1;2” should return three where the default delimiter is ‘;’ .
    2. the first line is optional. all existing scenarios should still be supported
5) Calling Add with a negative number will throw an exception “negatives not allowed” - and the negative that was passed.if there are multiple negatives, show all of them in the exception message

-----------------------------------------------------------------------------------------------------------------------
stop here if you are a beginner. Continue if you can finish the steps so far in less than 30 minutes.
-----------------------------------------------------------------------------------------------------------------------

6) Numbers bigger than 1000 should be ignored, so adding 2 + 1001  = 2
7) Delimiters can be of any length with the following format:  “//[delimiter]\n” for example: “//[***]\n1***2***3” should return 6
8) Allow multiple delimiters like this:  “//[delim1][delim2]\n” for example “//[*][%]\n1*2%3” should return 6.
9) make sure you can also handle multiple delimiters with length longer than one char
Something went wrong with that request. Please try again.