From 5e8657e2a7cdb4238a1519d289c2143f72358814 Mon Sep 17 00:00:00 2001 From: Ruben Egiluz Date: Tue, 10 May 2011 18:45:27 +0800 Subject: [PATCH] Solucion de la kata de abril en Groovy por Ruben Egiluz --- regiluze/Bowling/.idea/.name | 1 + regiluze/Bowling/.idea/ant.xml | 7 + regiluze/Bowling/.idea/compiler.xml | 21 + .../.idea/copyright/profiles_settings.xml | 5 + regiluze/Bowling/.idea/encodings.xml | 5 + regiluze/Bowling/.idea/misc.xml | 225 ++++++++ regiluze/Bowling/.idea/modules.xml | 9 + regiluze/Bowling/.idea/uiDesigner.xml | 125 +++++ regiluze/Bowling/.idea/vcs.xml | 7 + regiluze/Bowling/.idea/workspace.xml | 529 ++++++++++++++++++ regiluze/Bowling/KatayunoBowling.iml | 14 + regiluze/Bowling/src/Bowling.groovy | 30 + regiluze/Bowling/src/Frame.groovy | 134 +++++ regiluze/Bowling/test/BowlingTest.groovy | 88 +++ 14 files changed, 1200 insertions(+) create mode 100644 regiluze/Bowling/.idea/.name create mode 100644 regiluze/Bowling/.idea/ant.xml create mode 100644 regiluze/Bowling/.idea/compiler.xml create mode 100644 regiluze/Bowling/.idea/copyright/profiles_settings.xml create mode 100644 regiluze/Bowling/.idea/encodings.xml create mode 100644 regiluze/Bowling/.idea/misc.xml create mode 100644 regiluze/Bowling/.idea/modules.xml create mode 100644 regiluze/Bowling/.idea/uiDesigner.xml create mode 100644 regiluze/Bowling/.idea/vcs.xml create mode 100644 regiluze/Bowling/.idea/workspace.xml create mode 100644 regiluze/Bowling/KatayunoBowling.iml create mode 100644 regiluze/Bowling/src/Bowling.groovy create mode 100644 regiluze/Bowling/src/Frame.groovy create mode 100644 regiluze/Bowling/test/BowlingTest.groovy diff --git a/regiluze/Bowling/.idea/.name b/regiluze/Bowling/.idea/.name new file mode 100644 index 0000000..fbfdade --- /dev/null +++ b/regiluze/Bowling/.idea/.name @@ -0,0 +1 @@ +KatayunoBowling \ No newline at end of file diff --git a/regiluze/Bowling/.idea/ant.xml b/regiluze/Bowling/.idea/ant.xml new file mode 100644 index 0000000..2581ca3 --- /dev/null +++ b/regiluze/Bowling/.idea/ant.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/regiluze/Bowling/.idea/compiler.xml b/regiluze/Bowling/.idea/compiler.xml new file mode 100644 index 0000000..a1b41c5 --- /dev/null +++ b/regiluze/Bowling/.idea/compiler.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/regiluze/Bowling/.idea/copyright/profiles_settings.xml b/regiluze/Bowling/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/regiluze/Bowling/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/regiluze/Bowling/.idea/encodings.xml b/regiluze/Bowling/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/regiluze/Bowling/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/regiluze/Bowling/.idea/misc.xml b/regiluze/Bowling/.idea/misc.xml new file mode 100644 index 0000000..b7bf4ac --- /dev/null +++ b/regiluze/Bowling/.idea/misc.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.6 + + + + + + + + + + + + + + diff --git a/regiluze/Bowling/.idea/modules.xml b/regiluze/Bowling/.idea/modules.xml new file mode 100644 index 0000000..4b2762d --- /dev/null +++ b/regiluze/Bowling/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/regiluze/Bowling/.idea/uiDesigner.xml b/regiluze/Bowling/.idea/uiDesigner.xml new file mode 100644 index 0000000..3b00020 --- /dev/null +++ b/regiluze/Bowling/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/regiluze/Bowling/.idea/vcs.xml b/regiluze/Bowling/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/regiluze/Bowling/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/regiluze/Bowling/.idea/workspace.xml b/regiluze/Bowling/.idea/workspace.xml new file mode 100644 index 0000000..42ab27e --- /dev/null +++ b/regiluze/Bowling/.idea/workspace.xml @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + 1304151291045 + 1304151291045 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/regiluze/Bowling/KatayunoBowling.iml b/regiluze/Bowling/KatayunoBowling.iml new file mode 100644 index 0000000..665595d --- /dev/null +++ b/regiluze/Bowling/KatayunoBowling.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regiluze/Bowling/src/Bowling.groovy b/regiluze/Bowling/src/Bowling.groovy new file mode 100644 index 0000000..0f27b8a --- /dev/null +++ b/regiluze/Bowling/src/Bowling.groovy @@ -0,0 +1,30 @@ + +/** + * Created by IntelliJ IDEA. + * User: ruben + * Date: 30/04/11 + * Time: 10:26 + * To change this template use File | Settings | File Templates. + */ +class Bowling { + + int FRAME_NUM = 10 + + + def score(String rollsSecuence){ + + int totalScore = 0 + List framesRolls = Frame.getFrames(rollsSecuence) + int frameIndex = 0 + framesRolls.eachWithIndex { frame,i -> + if (i