Skip to content
This repository

Kata del mes de Enero del 2011: String Calculator

tree: 45d39cd871
Octocat-spinner-32 Aitortxu Fix repo April 16, 2011
Octocat-spinner-32 Arween17 Kata StringCalculator en Java June 02, 2011
Octocat-spinner-32 Capelare Updated test.c for the next step of the exercise. May 29, 2011
Octocat-spinner-32 GerardoGomez Primer paso terminado April 25, 2011
Octocat-spinner-32 JNavas Proyect de Joan Navarrete Sanchez March 27, 2012
Octocat-spinner-32 MuDestructor Fix repo April 16, 2011
Octocat-spinner-32 Sivainvi Fix repo April 16, 2011
Octocat-spinner-32 VictorVelarde Inicio del kata... April 25, 2011
Octocat-spinner-32 aabilio Fix repo April 16, 2011
Octocat-spinner-32 agileando Fix repo April 16, 2011
Octocat-spinner-32 agutierrez Fix repo April 16, 2011
Octocat-spinner-32 alejandrogomez refactorizar add() May 10, 2011
Octocat-spinner-32 alex952 Fix repo April 16, 2011
Octocat-spinner-32 alonsogarciapablo Fix repo April 16, 2011
Octocat-spinner-32 amaneiro Fix repo April 16, 2011
Octocat-spinner-32 amedio Test con saltos de lineas October 17, 2011
Octocat-spinner-32 amuino Fix repo April 16, 2011
Octocat-spinner-32 animalaes Fix repo April 16, 2011
Octocat-spinner-32 armenta-angel fuera ficheros eclipse August 19, 2011
Octocat-spinner-32 arturoherrero Fix repo April 16, 2011
Octocat-spinner-32 calavera Fix repo April 16, 2011
Octocat-spinner-32 cavalle Fix repo April 16, 2011
Octocat-spinner-32 cchau Added a Calculator Kata written in C April 16, 2011
Octocat-spinner-32 cibernox my first kata. It was fun! July 14, 2011
Octocat-spinner-32 darkturo Ended. Tookme 5 minutes more to finish this because of debbuging :-/ June 06, 2011
Octocat-spinner-32 davamix Fix repo April 16, 2011
Octocat-spinner-32 deadsunrise Fix repo April 16, 2011
Octocat-spinner-32 diegoguemes Separando responsabilidades en StringCalculator February 26, 2012
Octocat-spinner-32 discolo Fix repo April 16, 2011
Octocat-spinner-32 drodriguez Fix repo April 16, 2011
Octocat-spinner-32 eamodeorubio Fix repo April 16, 2011
Octocat-spinner-32 eferro Fix repo April 16, 2011
Octocat-spinner-32 ejosafat Fix repo April 16, 2011
Octocat-spinner-32 elmendalerenda Fix repo April 16, 2011
Octocat-spinner-32 enriclluelles ruby implementation October 20, 2011
Octocat-spinner-32 erpheus Fix repo April 16, 2011
Octocat-spinner-32 flype Fix repo April 16, 2011
Octocat-spinner-32 fperezpt Fix repo April 16, 2011
Octocat-spinner-32 gaizka Fix repo April 16, 2011
Octocat-spinner-32 germandz Fix repo April 16, 2011
Octocat-spinner-32 ggalmazor Fix repo April 16, 2011
Octocat-spinner-32 gonzalo123 Fix repo April 16, 2011
Octocat-spinner-32 harad Fix repo April 16, 2011
Octocat-spinner-32 hell03610 Fix repo April 16, 2011
Octocat-spinner-32 hvicente Fix repo April 16, 2011
Octocat-spinner-32 ialcazar Fix repo April 16, 2011
Octocat-spinner-32 ign4ci0 Fix repo April 16, 2011
Octocat-spinner-32 ikercelorrio After Test 5.2 - Brutal Refactor (Brutal?) Yeah! October 06, 2011
Octocat-spinner-32 j0hn Fix repo April 16, 2011
Octocat-spinner-32 jacegu Fix repo April 16, 2011
Octocat-spinner-32 japaz Fix repo April 16, 2011
Octocat-spinner-32 javisantana Fix repo April 16, 2011
Octocat-spinner-32 jbeerdev Fix repo April 16, 2011
Octocat-spinner-32 jesantana primer commit a 12meses12katas November 26, 2011
Octocat-spinner-32 jjfalcon Fix repo April 16, 2011
Octocat-spinner-32 jjuarez Fix repo April 16, 2011
Octocat-spinner-32 jlebrijo StringCalculator Java Kata, con video October 10, 2011
Octocat-spinner-32 jlopez Fix repo April 16, 2011
Octocat-spinner-32 jomarmen Fix repo April 16, 2011
Octocat-spinner-32 joseraya Fix repo April 16, 2011
Octocat-spinner-32 josmas Fix repo April 16, 2011
Octocat-spinner-32 jparcol Fix repo April 16, 2011
Octocat-spinner-32 jrdi Finish ruby version October 30, 2011
Octocat-spinner-32 jsayar Initial commit for kata of Jesus Sayar August 27, 2011
Octocat-spinner-32 juriarte Fix repo April 16, 2011
Octocat-spinner-32 kinisoftware Fix repo April 16, 2011
Octocat-spinner-32 lantoli get delimiters function improved April 25, 2011
Octocat-spinner-32 luque Fix repo April 16, 2011
Octocat-spinner-32 magmax Fix repo April 16, 2011
Octocat-spinner-32 manute Manute Kata November 27, 2011
Octocat-spinner-32 mariotux Fix repo April 16, 2011
Octocat-spinner-32 mfdez1982 Fix repo April 16, 2011
Octocat-spinner-32 mgryszko Fix repo April 16, 2011
Octocat-spinner-32 miguelerm Fix repo April 16, 2011
Octocat-spinner-32 minayaserrano Kata de Enero StringCalculator en PHP5.3 September 23, 2011
Octocat-spinner-32 montes Fix repo April 16, 2011
Octocat-spinner-32 neodevelop Mi solucion con groovy.. May 10, 2011
Octocat-spinner-32 penyaskito Fix repo April 16, 2011
Octocat-spinner-32 pereta Fix repo April 16, 2011
Octocat-spinner-32 plagelao Fix repo April 16, 2011
Octocat-spinner-32 porras Fix repo April 16, 2011
Octocat-spinner-32 prietopa Enero 12meses12katas September 20, 2011
Octocat-spinner-32 programania Fix repo April 16, 2011
Octocat-spinner-32 rafadc Fix repo April 16, 2011
Octocat-spinner-32 remosu Allow multiple delimiters April 30, 2011
Octocat-spinner-32 rmhdev (php) Kata resolved. Cleaning code. December 31, 2011
Octocat-spinner-32 robjperez Fix repo April 16, 2011
Octocat-spinner-32 rubendelafuente Fix repo April 16, 2011
Octocat-spinner-32 sergiogragera Kata enero: StringCalculator (Java) May 23, 2011
Octocat-spinner-32 sortega Fix repo April 16, 2011
Octocat-spinner-32 sourcerebels Fix repo April 16, 2011
Octocat-spinner-32 soyangel Fix repo April 16, 2011
Octocat-spinner-32 ssoto Fix repo April 16, 2011
Octocat-spinner-32 txingo Fix repo April 16, 2011
Octocat-spinner-32 xexu Fix repo April 16, 2011
Octocat-spinner-32 yodogi Final del ejercicio May 23, 2011
Octocat-spinner-32 README Fix repo April 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.