This commit is contained in:
Ovi Trif 2018-10-05 22:10:50 +00:00 committed by GitHub
commit 44fe456626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
257 changed files with 681 additions and 21391 deletions

View File

@ -1,17 +0,0 @@
exclude:
- /js/lib/.*
component_depth: 1
languages:
- cpp
- csharp
- go
- groovy
- java
- javascript
- perl
- php
- python
- ruby
- scala
- script
- swift

32
.gitignore vendored
View File

@ -1,7 +1,25 @@
.idea/workspace.xml
*.pyc
/perl6/lib/.precomp
/elixir/_build/
python/.cache
python/.coverage
**/.idea
.idea/
out/
*.class
*.iml
# Created by https://www.gitignore.io/api/gradle
### Gradle ###
.gradle
**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# End of https://www.gitignore.io/api/gradle

View File

@ -1 +0,0 @@
GuildedRose

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Java/Java.iml" filepath="$PROJECT_DIR$/Java/Java.iml" />
</modules>
</component>
</project>

View File

@ -1,5 +0,0 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,90 +0,0 @@
#include <string.h>
#include "GildedRose.h"
Item*
init_item(Item* item, const char *name, int sellIn, int quality)
{
item->sellIn = sellIn;
item->quality = quality;
item->name = strdup(name);
return item;
}
void update_quality(Item items[], int size)
{
int i;
for (i = 0; i < size; i++)
{
if (strcmp(items[i].name, "Aged Brie") && strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
if (!strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].sellIn < 11)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
if (items[i].sellIn < 6)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (strcmp(items[i].name, "Aged Brie"))
{
if (strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
items[i].quality = items[i].quality - items[i].quality;
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}

View File

@ -1,9 +0,0 @@
typedef struct
{
char *name;
int sellIn;
int quality;
} Item;
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
extern void update_quality(Item items[], int size);

View File

@ -1,43 +0,0 @@
#include <stdio.h>
#include "GildedRose.h"
int
print_item(Item *item)
{
return printf("%s, %d, %d\n", item->name, item->sellIn, item->quality);
}
int main()
{
Item items[9];
int last = 0;
int day;
int index;
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
init_item(items + last++, "Aged Brie", 2, 0);
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", -1, 80);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 10, 49);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 5, 49);
// this Conjured item doesn't yet work properly
init_item(items + last++, "Conjured Mana Cake", 3, 6);
puts("OMGHAI!");
for (day = 0; day <= 30; day++)
{
printf("-------- day %d --------\n", day);
printf("name, sellIn, quality\n");
for(index = 0; index < last; index++) {
print_item(items + index);
}
printf("\n");
update_quality(items, last);
}
return 0;
}

View File

@ -1,43 +0,0 @@
#include <CppUTest/TestHarness.h>
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTestExt/MockSupport.h>
extern "C" {
#include "GildedRose.h"
}
TEST_GROUP(TestGildedRoseGroup)
{
void setup() {
}
void teardown() {
}
};
TEST(TestGildedRoseGroup, FirstTest)
{
Item items[2];
init_item(items, "Foo", 0, 0);
update_quality(items, 1);
STRCMP_EQUAL("fixme", items[0].name);
}
void example()
{
Item items[6];
int last = 0;
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
init_item(items + last++, "Aged Brie", 2, 0);
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
init_item(items + last++, "Conjured Mana Cake", 3, 6);
update_quality(items, last);
}
int
main(int ac, char** av)
{
return CommandLineTestRunner::RunAllTests(ac, av);
}

View File

@ -1,51 +0,0 @@
# Makefile for building the kata file with the Google Testing Framework
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# Please tweak the following variable definitions as needed by your
# project.
# Points to the root of CppUTest, relative to where this file is.
# Remember to tweak this if you move this file.
CPPUTEST_HOME = CppUTest
# Where to find user code.
USER_DIR = .
# Flags passed to the preprocessor.
CPPFLAGS += -I$(CPPUTEST_HOME)/include
# Flags passed to the C++ compiler.
CFLAGS += -g -Wall -Wextra
LD_LIBRARIES = -L$(CPPUTEST_HOME)/lib -lCppUTest
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = GildedRoseUnitTests
TEXTTESTS = GildedRoseTextTests
# House-keeping build targets.
all : $(TESTS) $(TEXTTESTS)
GildedRose.o : $(USER_DIR)/GildedRose.c
GildedRoseUnitTests : $(USER_DIR)/GildedRoseUnitTests.cc GildedRose.o
$(CXX) $(CPPFLAGS) $(CFLAGS) -o $@ $(USER_DIR)/GildedRoseUnitTests.cc GildedRose.o $(LD_LIBRARIES)
GildedRoseTextTests.o : $(USER_DIR)/GildedRoseTextTests.c
GildedRoseTextTests : GildedRoseTextTests.o GildedRose.o
$(CC) $^ -o $@
clean :
rm -f $(TESTS) $(TEXTTESTS) *.o *~
check-syntax:
gcc $(CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}

View File

@ -1,5 +0,0 @@
run-once.sh runs your tests once
Assumptions:
- make and a C++ compiler (like gcc) is installed on your system and is in the PATH
- The CppUTest framework is in the directory CppUTest

View File

@ -1,2 +0,0 @@
make
./GildedRoseTextTests

View File

@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cobolProject" name="Gilded Rose" uuid="3529a385-3bb5-4b82-9b84-9e384fb2bdd4" version="4.0">
<settings xsi:type="projectSettingsContainer">
<copybook-paths xsi:type="copybookPathsSettings">
<path enabled="true" name="/Gilded Rose" type="mfpath"/>
</copybook-paths>
<build-precedence-paths xsi:type="buildPrecedenceSettings">
<path enabled="true" name="/Gilded Rose" type="mfpath"/>
</build-precedence-paths>
<configurations default="Gilded Rose" linkedWith="2017" xsi:type="buildConfigurationsContainer">
<configuration description="Gilded Rose" type="single_exe" is64bit="false" createlbr="false" platform="Windows" xsi:type="cobolBuildConfiguration">
<targetdir name="Gilded Rose.bin"/>
<application_configuration xsi:type="runtimeConfigurationSettings">
<cobol_switches xsi:type="projectCobolSwitches"/>
<rts_switches xsi:type="projectRtsSwitches"/>
<envScriptParameters></envScriptParameters>
<envScriptPath></envScriptPath>
<inheritBuildEnv>false</inheritBuildEnv>
<tunables>
<tunable index="0" name="screen_lines" value="25"/>
<tunable index="0" name="screen_cols" value="80"/>
<tunable index="0" name="default_cancel_mode" value="1"/>
<tunable index="0" name="program_search_order" value="4"/>
<tunable index="0" name="arguments_are_initial" value="false"/>
<tunable index="0" name="command_line_accept" value="false"/>
<tunable index="0" name="sort_memory" value="0"/>
<tunable index="0" name="dynamic_memory_limit" value="2147483647"/>
<tunable index="0" name="memory_free_check_size" value="100"/>
<tunable index="0" name="memory_strategy" value="1"/>
<tunable index="0" name="ansi_input_mode" value="false"/>
<tunable index="0" name="current_year" value="0"/>
<tunable index="0" name="current_month" value="0"/>
<tunable index="0" name="current_day" value="0"/>
<tunable index="0" name="datewarp_dynamic" value="false"/>
<tunable index="0" name="current_hour" value="-1"/>
<tunable index="0" name="current_minute" value="-1"/>
<tunable index="0" name="current_second" value="-1"/>
<tunable index="0" name="timewarp_dynamic" value="false"/>
</tunables>
</application_configuration>
<link_settings xsi:type="linkSettings">
<additional_options value=""/>
<rts_bind value="false"/>
<custom_link_command value=""/>
<debug value="false"/>
<entry_point name=""/>
<entry_point_runtime value="false"/>
<error_undefined_syms value="false"/>
<application_type value="console"/>
<include_cpp value="false"/>
<additional_files/>
<rcfile path=""/>
<rts_type value="shared"/>
<target name="Gilded Rose"/>
<targettype type="exe"/>
<threaded_rts value="true"/>
<verbose value="false"/>
</link_settings>
</configuration>
</configurations>
<cobol_settings xsi:type="cobolSettings">
<options>
<option name="WARNING" value="1"/>
<option name="DIALECT" value="MF"/>
<option name="CHARSET" value="ASCII"/>
<option name="SOURCEFORMAT" value="free"/>
<option name="MAX-ERROR" value="100"/>
</options>
<createJar value="false"/>
<createJarAfterBuild value="false"/>
<debug value="true"/>
<enableCodeCoverage value="true"/>
<enableProfiler value="false"/>
<generate value="false"/>
<retainDirectivesFile value="false"/>
<genListFile value="false"/>
<packageToFolderMapping value="false"/>
<useJvmDynamicCalls value="false"/>
<useJvmIncrementalBuild value="false"/>
<verbose value="false"/>
</cobol_settings>
<ims_settings xsi:type="additionalImsSettings">
<options>
<option id="generate_list_file" name="LIST" value="Listing/*.lst"/>
</options>
<verbose value="false"/>
<generatedFileDir name=""/>
<imsDatabaseDir name=""/>
</ims_settings>
<mfs_settings xsi:type="mfsSettings">
<options>
<option id="generate_list_file" name="LIST" value="Listing/MFS/*.lst"/>
</options>
<verbose value="false"/>
</mfs_settings>
<dbd_settings xsi:type="dbdSettings">
<options>
<option id="generate_list_file" name="LIST" value="Listing/DBD/*.lst"/>
</options>
<verbose value="false"/>
<cleanDbdOutputFiles value="false"/>
</dbd_settings>
<psb_settings xsi:type="psbSettings">
<options>
<option id="generate_list_file" name="LIST" value="Listing/PSB/*.lst"/>
</options>
<verbose value="false"/>
<cleanPsbOutputFiles value="false"/>
</psb_settings>
<bms_settings xsi:type="bmsSettings">
<options>
<option id="dsect" name="bmsSettings" value="/SYSPARM=DSECT"/>
<option id="decimalchar" name="bmsSettings" value="/DP=."/>
<option id="currencychar" name="bmsSettings" value="/CS=$"/>
<option id="sdf" name="bmsSettings" value="/IGNORE"/>
<option id="map" name="bmsSettings" value="/SYSPARM=MAP"/>
</options>
</bms_settings>
<dependent-projects xsi:type="dependentProjectsSettings"/>
<asm_settings xsi:type="assemblerCompileSettings">
<options>
<option id="compile_pre_assm_macros" name="mf370chk" value="NOMPC"/>
<option id="compile_mark_reentrant" name="mf370chk" value="RENT"/>
<option id="compile_create_optimized_code" name="mf370chk" value="NOOPT"/>
<option id="compile_aat_info" name="mf370chk" value="NOAAT"/>
<option id="compile_cross_ref_listing" name="mf370chk" value="NOXREF"/>
<option id="compile_create_debug_info" name="mf370chk" value="ANIM"/>
<option id="compile_generate_listing" name="mf370chk" value="NOLIST"/>
</options>
</asm_settings>
<asm_link_settings xsi:type="assemblerLinkSettings">
<options>
<option id="link_residency_mode" name="mf370lnk" value="RMODE(31)"/>
<option id="link_linker_output" name="mf370lnk" value="OMF(390)"/>
<option id="link_resolve_external" name="mf370lnk" value="CALL"/>
<option id="link_mark_reusable" name="mf370lnk" value="REUS"/>
<option id="link_generate_listing" name="mf370lnk" value="NOLIST"/>
<option id="link_create_debug_info" name="mf370lnk" value="ANIM"/>
<option id="link_mark_reentrant" name="mf370lnk" value="RENT"/>
<option id="link_addressing_mode" name="mf370lnk" value="AMODE(31)"/>
</options>
</asm_link_settings>
<asm_cics_settings enabled="false" xsi:type="assemblerCicsSettings">
<options>
<option id="cics_insert_epilog_macros" name="mf370chkCics" value="EPILOG"/>
<option id="cics_unsupported_option" name="mf370chkCics" value="UOPT(E)"/>
<option id="cics_insert_prolog_macros" name="mf370chkCics" value="PROLOG"/>
<option id="cics_unsupported_function" name="mf370chkCics" value="UFUNC(E)"/>
</options>
</asm_cics_settings>
<asm_autolink_settings enabled="true" xsi:type="assemblerAutoLinkSettings">
<options>
<option id="autolink_residency_mode" name="mf370chkAutoLink" value="RMODE(31)"/>
<option id="autolink_mark_reusable" name="mf370chkAutoLink" value="REUS"/>
<option id="autolink_resolve_external" name="mf370chkAutoLink" value="CALL"/>
<option id="autolink_linker_output" name="mf370chkAutoLink" value="OMF(390)"/>
<option id="autolink_addressing_mode" name="mf370chkAutoLink" value="AMODE(31)"/>
</options>
</asm_autolink_settings>
</settings>
<files xsi:type="projectFileStore">
<filetype type="cobol" xsi:type="cobolFileContainer">
<file compile="true" path="GildedRose.cbl" xsi:type="cobolFile"/>
</filetype>
<filetype type="cobol.copybook" xsi:type="cobolFileContainer"/>
</files>
</project>

View File

@ -1,2 +0,0 @@
.cobolBuild
/Gilded_Rose.bin/

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Gilded Rose</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.microfocus.eclipse.project.cobolBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.microfocus.eclipse.project.cobolNature</nature>
</natures>
</projectDescription>

View File

@ -1,72 +0,0 @@
program-id. GildedRose as "GildedRose".
file-control.
select in-items assign 'in-items'.
select items assign 'items'.
data division.
file section.
fd in-items.
01 in-item pic x(58).
fd items.
01 item.
02 sell-in pic 9(4).
02 quality pic 9(4).
02 name pic x(50).
working-storage section.
procedure division.
open input in-items output items.
start-lable.
read in-items end go to end-lable.
move in-item to item.
if name not equal "Aged Brie" and name not equal "Backstage passes to a TAFKAL80ETC concert"
if quality greater then 0
if name not equal to "Sulfuras, Hand of Ragnaros"
compute quality = quality - 1
end-if
end-if
else
if quality is less then 50
compute quality = quality + 1
if name equals "Backstage passes to a TAFKAL80ETC concert"
if sell-in less then 11
if quality less then 50
compute quality = quality + 1
end-if
end-if
if sell-in less then 6
if quality less then 50
compute quality = quality + 1
end-if
end-if
end-if
end-if
end-if
if name not equal "Sulfuras, Hand of Ragnaros"
compute sell-in = sell-in - 1
end-if
if sell-in is less then 0
if name is not equal to "Aged Brie"
if name is not equal to "Backstage passes to a TAFKAL80ETC concert"
if quality is greater then 0
if name is equal to "Sulfuras, Hand of Ragnaros"
compute quality = quality - 1
end-if
end-if
else
compute quality = quality - quality
end-if
else
if quality is less then 50
compute quality = quality + 1
end-if
end-if
end-if
write item.
go to start-lable.
end-lable.
close items.
goback.
end program GildedRose.

View File

@ -1,45 +0,0 @@
# Especificaciones de la Rosa Dorada (Gilded Rose)
Bienvenido al equipo de **Gilded Rose**.
Como quizá sabes, somos una pequeña posada ubicada estratégicamente en una prestigiosa ciudad, atendida por la amable **Allison**.
También compramos y vendemos mercadería de alta calidad.
Por desgracia, nuestra mercadería va bajando de calidad a medida que se aproxima la fecha de venta.
Tenemos un sistema instalado que actualiza automáticamente el `inventario`.
Este sistema fue desarrollado por un muchacho con poco sentido común llamado Leeroy, que ahora se dedica a nuevas aventuras.
Tu tarea es agregar una nueva característica al sistema para que podamos comenzar a vender una nueva categoría de items.
## Descripción preliminar
Pero primero, vamos a introducir el sistema:
* Todos los artículos (`Item`) tienen una propiedad `sellIn` que denota el número de días que tenemos para venderlo
* Todos los artículos tienen una propiedad `quality` que denota cúan valioso es el artículo
* Al final de cada día, nuestro sistema decrementa ambos valores para cada artículo mediante el método `updateQuality`
Bastante simple, ¿no? Bueno, ahora es donde se pone interesante:
* Una vez que ha pasado la fecha recomendada de venta, la `calidad` se degrada al doble de velocidad
* La `calidad` de un artículo nunca es negativa
* El "Queso Brie envejecido" (`Aged brie`) incrementa su `calidad` a medida que se pone viejo
* Su `calidad` aumenta en `1` unidad cada día
* luego de la `fecha de venta` su `calidad` aumenta `2` unidades por día
* La `calidad` de un artículo nunca es mayor a `50`
* El artículo "Sulfuras" (`Sulfuras`), siendo un artículo legendario, no modifica su `fecha de venta` ni se degrada en `calidad`
* Una "Entrada al Backstage", como el queso brie, incrementa su `calidad` a medida que la `fecha de venta` se aproxima
* si faltan 10 días o menos para el concierto, la `calidad` se incrementa en `2` unidades
* si faltan 5 días o menos, la `calidad` se incrementa en `3` unidades
* luego de la `fecha de venta` la `calidad` cae a `0`
## El requerimiento
Hace poco contratamos a un proveedor de artículos *conjurados mágicamente*.
Esto requiere una actualización del sistema:
* Los artículos `conjurados` degradan su `calidad` al doble de velocidad que los normales
Siéntete libre de realizar cualquier cambio al mensaje `updateQuality` y agregar el código que sea necesario, mientras que todo siga funcionando correctamente. Sin embargo, **no alteres el objeto `Item` ni sus propiedades** ya que pertenecen al goblin que está en ese rincón, que en un ataque de ira te va a liquidar de un golpe porque no cree en la cultura de código compartido.
## Notas finales
Para aclarar: un artículo nunca puede tener una `calidad` superior a `50`, sin embargo las Sulfuras siendo un artículo legendario posee una calidad inmutable de `80`.

View File

@ -1,41 +0,0 @@
# Spécification de la Rose dorée (Gilded Rose)
Bonjour et bienvenue dans l'équipe de la Rose dorée.
Comme vous le savez, notre petite taverne située à proximité d'une cité importante est dirigée par l'amicale aubergiste Allison.
Nous achetons et vendons uniquement les meilleurs produits.
Malheureusement, la qualité de nos marchandises se dégrade constamment à l'approche de leur date de péremption.
Un système a été mis en place pour mettre à jour notre inventaire.
Il a été développé par Leeroy, une personne pleine de bon sens qui est parti pour de nouvelles aventures.
Votre mission est d'ajouter une nouvelle fonctionnalité à notre système pour que nous puissions commencer à vendre un nouveau type de produit.
Mais d'abord, laissez-moi vous présenter notre système :
- Tous les éléments ont une valeur `sellIn` qui désigne le nombre de jours restant pour vendre l'article.
- Tous les articles ont une valeur `quality` qui dénote combien l'article est précieux.
- A la fin de chaque journée, notre système diminue ces deux valeurs pour chaque produit.
Plutôt simple, non ?
Attendez, ça devient intéressant :
- Une fois que la date de péremption est passée, la qualité se dégrade deux fois plus rapidement.
- La qualité (`quality`) d'un produit ne peut jamais être négative.
- "Aged Brie" augmente sa qualité (`quality`) plus le temps passe.
- La qualité d'un produit n'est jamais de plus de 50.
- "Sulfuras", étant un objet légendaire, n'a pas de date de péremption et ne perd jamais en qualité (`quality`)
- "Backstage passes", comme le "Aged Brie", augmente sa qualité (`quality`) plus le temps passe (`sellIn`) ; La qualité augmente de 2 quand il reste 10 jours ou moins et de 3 quand il reste 5 jours ou moins, mais la qualité tombe à 0 après le concert.
Nous avons récemment signé un partenariat avec un fournisseur de produit invoqué ("Conjured").
Cela nécessite une mise à jour de notre système :
- les éléments "Conjured" voient leur qualité se dégrader de deux fois plus vite que les objets normaux.
Vous pouvez faire les changements que vous voulez à la méthode `updateQuality` et ajouter autant de code que vous voulez, tant que tout fonctionne correctement.
Cependant, nous devons vous prévenir, ne devez modifier en aucun cas la classe `Item` ou ses propriétés car cette classe appartient au gobelin de l'étage et il rentrera dans une rage instantanée et vous tuera sans délai : il ne croit pas dans le partage du code.
(Vous pouvez ajouter une méthode `updateQuality` et des propriétés statiques dans la classe `Item` si vous voulez, nous vous couvrirons)
Juste une précision, un produit ne peut jamais voir sa qualité augmenter au-dessus de 50, cependant "Sulfuras" est un objet légendaire et comme tel sa qualité est de 80 et il ne change jamais.

View File

@ -1,35 +0,0 @@
# Especificações de Requisitos de Gilded Rose
Bem-vindo ao time Gilded Rose. Como você deve saber, nós somos uma pequena pousada estrategicamente localizada em uma prestigiosa cidade, atendida pelo amigavel atendente Allison. Além de ser uma pousada, nós também compramos e vendemos as mercadorias de melhor qualidade. Infelizmente nossas mercadorias vão perdendo a qualidade conforme chegam próximo sua data de venda.
Nós temos um sistema instalado que atualiza automaticamente os preços do nosso estoque. Esse sistema foi criado por um rapaz sem noção chamado Leeroy, que agora se dedica à novas aventuras. Seu trabalho será adicionar uma nova funcionalidade para o nosso sistema para que possamos vender uma nova categoria de itens.
## Descrição preliminar
Vamos dar uma breve introdução do nosso sistema:
* Todos os itens (classe `Item`) possuem uma propriedade chamada `SellIn` que informa o número de dias que temos para vende-lo
* Todos os itens possuem uma propriedade chamada `quality` que informa o quão valioso é o item.
* No final do dia, nosso sistema decrementa os valores das propriedades `SellIn` e `quality` de cada um dos itens do estoque através do método `updateQuality`.
Bastante simples, não é? Bem, agora que as coisas ficam interessantes:
* Quando a data de venda do item tiver passado, a qualidade (`quality`) do item diminui duas vezes mais rapido.
* A qualidade (`quality`) do item não pode ser negativa
* O "Queijo Brie envelhecido" (`Aged Brie`), aumenta sua qualidade (`quality`) em `1` unidade a medida que envelhece.
* A qualidade (`quality`) de um item não pode ser maior que 50.
* O item "Sulfuras" (`Sulfuras`), por ser um item lendário, não precisa ter uma data de venda (`SellIn`) e sua qualidade (`quality`) não precisa ser diminuida.
* O item "Entrada para os Bastidores" (`Backstage Passes`), assim como o "Queijo Brie envelhecido", aumenta sua qualidade (`quality`) a medida que o dia da venda (`SellIn`) se aproxima;
* A qualidade (`quality`) aumenta em `2` unidades quando a data de venda (`SellIn`) é igual ou menor que `10`.
* A qualidade (`quality`) aumenta em `3` unidades quando a data de venda (`SellIn`) é igual ou menor que `5`.
* A qualidade (`quality`) do item vai direto à `0` quando a data de venda (`SellIn`) tiver passado.
Nós recentemente assinamos um suprimento de itens Conjurados Magicamente. Isto requer que nós atualizemos nosso sistema:
* Os itens "Conjurados" (`Conjured`) diminuem a qualidade (`quality`) duas vezes mais rápido que os outros itens.
Sinta-se livre para fazer qualquer alteração no método `updateQuality` e adicionar código novo contanto que tudo continue funcionando perfeitamente. Entretanto, não altere o código da classe `Item` ou da propriedade `Items` na classe `GildedRose` pois elas pertencem ao Goblin que irá te matar com um golpe pois ele não acredita na cultura de código compartilhado.
## Notas Finais
Para esclarecer: Um item não pode ter uma qualidade (`quality`) maior que `50`, entretanto as "Sulfuras" por serem um item lendário vão ter uma qualidade imutavel de `80`.

View File

@ -1,43 +0,0 @@
======================================
Технические требования «Gilded Rose»
======================================
Привет и добро пожаловать в команду «Gilded Rose». Как вы знаете, мы небольшая гостиница удобно расположенная
в известном городе под руководством дружественного управляющего по имени Эллисон. Также мы занимаемся покупкой
и продажей только самых лучших товаров. К несчастью, качество наших товаров постоянно ухудшается по мере приближения
к максимальному сроку хранения. Существует информационная система, которая ведет переучет всех товаров. Система
была разработана рубаха-парнем, по имени Leeroy, который отправился за поисками новых приключений. Ваша задача
заключается в том, чтобы добавить новый функционал в нашу систему, чтобы мы могли начать продавать новую категорию
товаров.
В общих чертах система работает следующим образом:
- Все товары имеют свойство «sellIn» (срок хранения), которое обозначает количество
дней в течение которых мы должны продать товар;
- Все товары имеют свойство «Quality» (качество), которое обозначает насколько качественным является товар;
- В конце дня наша система снижает значение обоих свойств для каждого товара.
Довольно просто, не правда ли? Тут-то и начинается самое интересное:
- После того, как срок храния прошел, качество товара ухудшается в два раза быстрее;
- Качество товара никогда не может быть отрицательным;
- Для товара «Aged Brie» качество увеличивается пропорционально возрасту;
- Качество товара никогда не может быть больше, чем 50;
- «Sulfuras» является легендарным товаром, поэтому у него нет срока хранения и не подвержен ухудшению качества;
- Качество «Backstage passes» также, как и «Aged Brie», увеличивается по мере приближения к сроку хранения.
Качество увеличивается на 2, когда до истечения срока хранения 10 или менее дней и на 3,
если до истечения 5 или менее дней. При этом качество падает до 0 после даты проведения концерта.
Недавно мы нашли поставщика магических товаров. Для того, чтобы продавать его товары необходимо обновить нашу
систему следующим образом:
- «Conjured» товары теряют качество в два раза быстрее, чем обычные товары.
Не стесняйтесь вносить любые изменения в метод «UpdateQuality» и добавлять любой новый код до тех пор,
пока система работает корректно. Тем не менее, не меняйте класс «Item» или его свойства, так как он принадлежит
сидящему в углу гоблину, который очень яростен и поэтому выстрелит в вас поскольку не верит в принцип
совместного владения кодом (вы можете сделать метод «UpdateQuality» и свойства класса «Item» статическими
если хотите, мы вас прикроем).
Просто для уточнения, товар никогда не может иметь качество выше чем 50, однако легендарный товар «Sulfuras»
имеет качество 80 и оно никогда не меняется.

View File

@ -1,32 +0,0 @@
======================================
Gilded Rose 需求描述
======================================
欢迎来到镶金玫瑰(Gilded Rose)团队。如你所知我们是主城中的一个小旅店店主非常友好名叫Allison。我们也售卖最好的物品。不幸的是物品品质会随着销售期限的接近而不断下降。
我们有一个系统来更新库存信息。系统是由一个无名之辈Leeroy所开发的他已经不在这了。
你的任务是添加新功能,这样我们就可以售卖新的物品。
先介绍一下我们的系统:
- 每种物品都具备一个`SellIn`值,表示我们要在多少天之前把物品卖出去,即销售期
- 每种的物品都具备一个`Quality`值,表示物品的品质
- 每天结束时,系统会降低每种物品的这两个数值
很简单吧?这还有些更有意思的:
- 一旦销售期限过期,品质`Quality`会以双倍速度加速下降
- 物品的品质`Quality`永远不会为负值
- "Aged Brie"的品质`Quality`会随着时间推移而提高
- 物品的品质`Quality`永远不会超过50
- 传奇物品"Sulfuras"永不到期,也不会降低品质`Quality`
- "Backstage passes"与aged brie类似其品质`Quality`会随着时间推移而提高当还剩10天或更少的时候品质`Quality`每天提高2当还剩5天或更少的时候品质`Quality`每天提高3但一旦过期品质就会降为0
我们最近签约了一个召唤物品供应商。这需要对我们的系统进行升级:
- "Conjured"物品的品质`Quality`下降速度比正常物品快一倍
请随意对UpdateQuality()函数进行修改和添加新代码只要系统还能正常工作。然而不要修改Item类或其属性因为那属于角落里的地精他会非常愤怒地爆你头因为他不相信代码共享所有制如果你愿意你可以将UpdateQuality方法和Items属性改为静态的我们会掩护你的
再次澄清每种物品的品质不会超过50然而"Sulfuras"是一个传奇物品因此它的品质是80且永远不变。

124
Groovy/.gitignore vendored
View File

@ -1,124 +0,0 @@
# Created by https://www.gitignore.io/api/groovy,intellij,eclipse,vim
#!! ERROR: groovy is undefined. Use list command to see defined gitignore types !!#
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Groovy.iml" filepath="$PROJECT_DIR$/Groovy.iml" />
</modules>
</component>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Current Groovy (sdkman)" level="application" />
</component>
</module>

View File

@ -1,17 +0,0 @@
Welcome to the Groovy Gilded Rose
=================================
to run the test, you can either:
- run them from your favorite IDE
- make sure you have installed language support for Groovy
- IntelliJ:
- open project
- choose this folder (Groovy)
- Eclipse:
- new Groovy Project
- choose this folder (Groovy) as the project folder
- add JUnit to build path
- run the test from the src/ folder in your shell:
- $ cd src/
- $ groovy com/gildedrose/GildedRoseTest.groovy

View File

@ -1,62 +0,0 @@
package com.gildedrose
class GildedRose {
Item[] items
GildedRose(Item[] items) {
this.items = items
}
void updateQuality() {
for (int i = 0; i < items.length; i++) {
if (!items[i].name.equals("Aged Brie")
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1
}
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
}
}
if (items[i].sellIn < 6) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
}
}
}
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].sellIn = items[i].sellIn - 1
}
if (items[i].sellIn < 0) {
if (!items[i].name.equals("Aged Brie")) {
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1
}
}
} else {
items[i].quality = items[i].quality - items[i].quality
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
}
}
}
}
}
}

View File

@ -1,15 +0,0 @@
package com.gildedrose
import org.junit.Test
class GildedRoseTest {
@Test
void "foo"() {
def items = [ new Item("foo", 0, 0) ] as Item[]
def app = new GildedRose(items)
app.updateQuality()
assert "fixme" == app.items[0].name
}
}

View File

@ -1,21 +0,0 @@
package com.gildedrose
class Item {
String name
int sellIn
int quality
Item(String name, int sellIn, int quality) {
this.name = name
this.sellIn = sellIn
this.quality = quality
}
@Override
String toString() {
return this.name + ", " + this.sellIn + ", " + this.quality
}
}

View File

@ -1,32 +0,0 @@
package com.gildedrose
println("OMGHAI!")
Item[] items = [
new Item("+5 Dexterity Vest", 10, 20),
new Item("Aged Brie", 2, 0),
new Item("Elixir of the Mongoose", 5, 7),
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
// this conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6)] as Item[]
GildedRose app = new GildedRose(items)
int days = 2
if (args.length > 0) {
days = Integer.parseInt(args[0]) + 1
}
for (int i = 0; i < days; i++) {
println("-------- day " + i + " --------")
println("name, sellIn, quality")
for (Item item in items) {
println(item)
}
println ""
app.updateQuality()
}

View File

@ -1,3 +0,0 @@
.idea/
.gradle/
build/

View File

@ -1,9 +0,0 @@
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}

Binary file not shown.

160
Java - Spock/gradlew vendored
View File

@ -1,160 +0,0 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

View File

@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,62 +0,0 @@
package com.gildedrose;
class GildedRose {
Item[] items;
public GildedRose(Item[] items) {
this.items = items;
}
public void updateQuality() {
for (int i = 0; i < items.length; i++) {
if (!items[i].name.equals("Aged Brie")
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1;
}
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
if (items[i].sellIn < 6) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
}
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0) {
if (!items[i].name.equals("Aged Brie")) {
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1;
}
}
} else {
items[i].quality = items[i].quality - items[i].quality;
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
}
}
}
}

View File

@ -1,21 +0,0 @@
package com.gildedrose;
public class Item {
public String name;
public int sellIn;
public int quality;
public Item(String name, int sellIn, int quality) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
}
@Override
public String toString() {
return this.name + ", " + this.sellIn + ", " + this.quality;
}
}

View File

@ -1,37 +0,0 @@
package com.gildedrose;
public class TexttestFixture {
public static void main(String[] args) {
System.out.println("OMGHAI!");
Item[] items = new Item[] {
new Item("+5 Dexterity Vest", 10, 20), //
new Item("Aged Brie", 2, 0), //
new Item("Elixir of the Mongoose", 5, 7), //
new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
// this conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6) };
GildedRose app = new GildedRose(items);
int days = 2;
if (args.length > 0) {
days = Integer.parseInt(args[0]) + 1;
}
for (int i = 0; i < days; i++) {
System.out.println("-------- day " + i + " --------");
System.out.println("name, sellIn, quality");
for (Item item : items) {
System.out.println(item);
}
System.out.println();
app.updateQuality();
}
}
}

View File

@ -1,25 +0,0 @@
package com.gildedrose
import spock.lang.Specification
/**
* Spock unit tests.
*/
class GildedRoseSpec extends Specification {
def "should update quality correctly"() {
given: "some items"
Item[] items = [new Item("foo", 0, 0)];
and: "the application with these items"
GildedRose app = new GildedRose(items);
when: "updating quality"
app.updateQuality();
then: "the quality is correct"
app.items[0].name == "fixme"
}
}

8
Java/.gitignore vendored
View File

@ -1,8 +0,0 @@
.idea/
*.iml
target/
.classpath
.project
bin/
.settings/

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gildedrose</groupId>
<artifactId>gilded-rose-kata</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,62 +0,0 @@
package com.gildedrose;
class GildedRose {
Item[] items;
public GildedRose(Item[] items) {
this.items = items;
}
public void updateQuality() {
for (int i = 0; i < items.length; i++) {
if (!items[i].name.equals("Aged Brie")
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1;
}
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
if (items[i].sellIn < 6) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
}
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0) {
if (!items[i].name.equals("Aged Brie")) {
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
items[i].quality = items[i].quality - 1;
}
}
} else {
items[i].quality = items[i].quality - items[i].quality;
}
} else {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
}
}
}
}
}
}

View File

@ -1,21 +0,0 @@
package com.gildedrose;
public class Item {
public String name;
public int sellIn;
public int quality;
public Item(String name, int sellIn, int quality) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
}
@Override
public String toString() {
return this.name + ", " + this.sellIn + ", " + this.quality;
}
}

View File

@ -1,17 +0,0 @@
package com.gildedrose;
import static org.junit.Assert.*;
import org.junit.Test;
public class GildedRoseTest {
@Test
public void foo() {
Item[] items = new Item[] { new Item("foo", 0, 0) };
GildedRose app = new GildedRose(items);
app.updateQuality();
assertEquals("fixme", app.items[0].name);
}
}

View File

@ -1,37 +0,0 @@
package com.gildedrose;
public class TexttestFixture {
public static void main(String[] args) {
System.out.println("OMGHAI!");
Item[] items = new Item[] {
new Item("+5 Dexterity Vest", 10, 20), //
new Item("Aged Brie", 2, 0), //
new Item("Elixir of the Mongoose", 5, 7), //
new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
// this conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6) };
GildedRose app = new GildedRose(items);
int days = 2;
if (args.length > 0) {
days = Integer.parseInt(args[0]) + 1;
}
for (int i = 0; i < days; i++) {
System.out.println("-------- day " + i + " --------");
System.out.println("name, sellIn, quality");
for (Item item : items) {
System.out.println(item);
}
System.out.println();
app.updateQuality();
}
}
}

25
Kotlin/.gitignore vendored
View File

@ -1,25 +0,0 @@
.idea/
out/
*.class
*.iml
# Created by https://www.gitignore.io/api/gradle
### Gradle ###
.gradle
**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# End of https://www.gitignore.io/api/gradle

View File

@ -1,35 +0,0 @@
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.21"
}
apply plugin: 'kotlin'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile 'junit:junit:4.12'
}
repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

View File

@ -1,5 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip

View File

@ -1,19 +0,0 @@
package com.gildedrose
import org.junit.Assert.*
import org.junit.Test
class GildedRoseTest {
@Test fun foo() {
val items = arrayOf<Item>(Item("foo", 0, 0))
val app = GildedRose(items)
app.updateQuality()
assertEquals("fixme", app.items[0].name)
}
}

View File

@ -1,36 +0,0 @@
package com.gildedrose
fun main(args: Array<String>) {
println("OMGHAI!")
val items = arrayOf(Item("+5 Dexterity Vest", 10, 20), //
Item("Aged Brie", 2, 0), //
Item("Elixir of the Mongoose", 5, 7), //
Item("Sulfuras, Hand of Ragnaros", 0, 80), //
Item("Sulfuras, Hand of Ragnaros", -1, 80),
Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
// this conjured item does not work properly yet
Item("Conjured Mana Cake", 3, 6))
val app = GildedRose(items)
var days = 2
if (args.size > 0) {
days = Integer.parseInt(args[0]) + 1
}
for (i in 0..days - 1) {
println("-------- day $i --------")
println("name, sellIn, quality")
for (item in items) {
println(item)
}
println()
app.updateQuality()
}
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 @emilybache
Copyright (c) 2018 Ovi Trif
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GildedRose.R</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>de.walware.statet.r.builders.RSupport</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>de.walware.statet.base.StatetNature</nature>
<nature>de.walware.statet.r.RNature</nature>
</natures>
</projectDescription>

View File

@ -1,56 +0,0 @@
source('item.R')
update_quality <- function(items) {
lapply(items,
function(item) {
if (item$name != "Aged Brie" && item$name != "Backstage passes to a TAFKAL80ETC concert") {
if (item$quality > 0) {
if (item$name != "Sulfuras, Hand of Ragnaros") {
item$quality <- item$quality - 1
}
}
} else {
if (item$quality < 50) {
item$quality <- item$quality + 1
if (item$name == "Backstage passes to a TAFKAL80ETC concert") {
if (item$sell_in < 11) {
if (item$quality < 50) {
item$quality = item$quality + 1
}
}
if (item$sell_in < 6) {
if (item$quality < 50) {
item$quality = item$quality + 1
}
}
}
}
}
if (item$name != "Sulfuras, Hand of Ragnaros") {
item$sell_in <- item$sell_in - 1
}
if (item$sell_in < 0) {
if (item$name != "Aged Brie") {
if (item$name != "Backstage passes to a TAFKAL80ETC concert") {
if (item$quality > 0) {
if (item$name != "Sulfuras, Hand of Ragnaros") {
item$quality <- item$quality - 1
}
}
} else {
item$quality <- item$quality - item$quality
}
} else {
if (item$quality < 50) {
item$quality <- item$quality + 1
}
}
}
item
}
)
}

View File

@ -1,13 +0,0 @@
item <- function(name, sell_in, quality) {
newItem <- list(name=name, sell_in=sell_in, quality=quality)
class(newItem) <- 'item'
newItem
}
as.character.item <- function(item) {
paste(item$name, ", ", item$sell_in, ", ", item$quality, sep='')
}
print.item <- function(item) {
print.default(as.character(item))
}

View File

@ -1,7 +0,0 @@
source('gilded_rose.R')
test.foo <- function() {
items <- list( item('foo', 0, 0) )
items <- update_quality(items)
checkEquals('fixme', items[[1]]$name);
}

View File

@ -1,7 +0,0 @@
# A little helper script to get the testing infrastructure started
# install.packages("RUnit")
require(RUnit)
# execute single test file
runTestFile("runit_gilded_rose.R")

View File

@ -1,33 +0,0 @@
rm(list=ls())
source('gilded_rose.R')
writeLines('OMGHAI!')
items <- list(
item('+5 Dexterity Vest', 10, 20),
item('Aged Brie', 2, 0),
item('Elixir of the Mongoose', 5, 7),
item('Sulfuras, Hand of Ragnaros', 0, 80),
item('Sulfuras, Hand of Ragnaros', -1, 80),
item('Backstage passes to a TAFKAL80ETC concert', 15, 20),
item('Backstage passes to a TAFKAL80ETC concert', 10, 49),
item('Backstage passes to a TAFKAL80ETC concert', 5, 49),
# This Conjured item does not work properly yet
item('Conjured Mana Cake', 3, 6)
)
days <- 2
for (day in 0:days) {
writeLines(paste('-------- day ', day, ' --------', sep=''))
writeLines('name, sellIn, quality')
lapply(items,
function(item) {
writeLines(as.character(item))
}
)
writeLines('')
items <- update_quality(items)
}
rm('day', 'days', 'items')

View File

@ -1,49 +1,5 @@
# Gilded Rose Refactoring Kata
This Kata was originally created by Terry Hughes (http://twitter.com/TerryHughes). It is already on GitHub [here](https://github.com/NotMyself/GildedRose). See also [Bobby Johnson's description of the kata](http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/).
## Build
I translated the original C# into a few other languages, (with a little help from my friends!), and slightly changed the starting position. This means I've actually done a small amount of refactoring already compared with the original form of the kata, and made it easier to get going with writing tests by giving you one failing unit test to start with. I also added test fixtures for Text-Based approval testing with TextTest (see [the TextTests](https://github.com/emilybache/GildedRose-Refactoring-Kata/tree/master/texttests))
As Bobby Johnson points out in his article ["Why Most Solutions to Gilded Rose Miss The Bigger Picture"](http://iamnotmyself.com/2012/12/07/why-most-solutions-to-gilded-rose-miss-the-bigger-picture), it'll actually give you
better practice at handling a legacy code situation if you do this Kata in the original C#. However, I think this kata
is also really useful for practicing writing good tests using different frameworks and approaches, and the small changes I've made help with that. I think it's also interesting to compare what the refactored code and tests look like in different programming languages.
I wrote this article ["Writing Good Tests for the Gilded Rose Kata"](http://coding-is-like-cooking.info/2013/03/writing-good-tests-for-the-gilded-rose-kata/) about how you could use this kata in a [coding dojo](https://leanpub.com/codingdojohandbook).
## How to use this Kata
The simplest way is to just clone the code and start hacking away improving the design. You'll want to look at the ["Gilded Rose Requirements"](https://github.com/emilybache/GildedRose-Refactoring-Kata/tree/master/GildedRoseRequirements.txt) which explains what the code is for. I strongly advise you that you'll also need some tests if you want to make sure you don't break the code while you refactor.
You could write some unit tests yourself, using the requirements to identify suitable test cases. I've provided a failing unit test in a popular test framework as a starting point for most languages.
Alternatively, use the "Text-Based" tests provided in this repository. (Read more about that in the next section)
Whichever testing approach you choose, the idea of the exercise is to do some deliberate practice, and improve your skills at designing test cases and refactoring. The idea is not to re-write the code from scratch, but rather to practice designing tests, taking small steps, running the tests often, and incrementally improving the design.
## Text-Based Approval Testing
This is a testing approach which is very useful when refactoring legacy code. Before you change the code, you run it, and gather the output of the code as a plain text file. You review the text, and if it correctly describes the behaviour as you understand it, you can "approve" it, and save it as a "Golden Master". Then after you change the code, you run it again, and compare the new output against the Golden Master. Any differences, and the test fails.
It's basically the same idea as "assertEquals(expected, actual)" in a unit test, except the text you are comparing is typically much longer, and the "expected" value is saved from actual output, rather than being defined in advance.
Typically a piece of legacy code may not produce suitable textual output from the start, so you may need to modify it before you can write your first text-based approval test. That could involve inserting log statements into the code, or just writing a "main" method that executes the code and prints out what the result is afterwards. It's this latter approach we are using here to test GildedRose.
The Text-Based tests in this repository are designed to be used with the tool "TextTest" (http://texttest.org). This tool helps you to organize and run text-based tests. There is more information in the README file in the "texttests" subdirectory.
## Get going quickly using Cyber-Dojo
I've also set this kata up on [cyber-dojo](http://cyber-dojo.org) for several languages, so you can get going really quickly:
- [JUnit, Java](http://cyber-dojo.org/forker/fork/751DD02C4C?avatar=snake&tag=8)
- [C#](http://cyber-dojo.org/forker/fork/5C5AC766B0?avatar=koala&tag=3)
- [C++](http://cyber-dojo.org/forker/fork/AA86ECBCC9?avatar=rhino&tag=7)
- [Ruby](http://cyber-dojo.org/forker/fork/A8943EAF92?avatar=hippo&tag=9)
- [RSpec, Ruby](http://cyber-dojo.org/forker/fork/8E58B0AD16?avatar=raccoon&tag=3)
- [Python](http://cyber-dojo.org/forker/fork/297041AA7A?avatar=lion&tag=4)
- [Cucumber, Java](http://cyber-dojo.org/forker/fork/0F82D4BA89?avatar=gorilla&tag=48) - for this one I've also written some step definitions for you
## Better Code Hub
I analysed this repo according to the clean code standards on [Better Code Hub](https://bettercodehub.com) just to get an independent opinion of how bad the code is. Perhaps unsurprisingly, the compliance score is low!
[![BCH compliance](https://bettercodehub.com/edge/badge/emilybache/GildedRose-Refactoring-Kata?branch=master)](https://bettercodehub.com/)
TODO

File diff suppressed because one or more lines are too long

10
TypeScript/.gitignore vendored
View File

@ -1,10 +0,0 @@
.DS_Store
.idea
node_modules
typings
app/**/*.js
app/**/*.js.map
test/**/*.js
test/**/*.js.map
coverage
.nyc_output

View File

@ -1,69 +0,0 @@
export class Item {
name: string;
sellIn: number;
quality: number;
constructor(name, sellIn, quality) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
}
}
export class GildedRose {
items: Array<Item>;
constructor(items = []) {
this.items = items;
}
updateQuality() {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].name != 'Aged Brie' && this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
}
}
} else {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
if (this.items[i].name == 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
}
}
if (this.items[i].sellIn < 6) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
}
}
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].sellIn = this.items[i].sellIn - 1;
}
if (this.items[i].sellIn < 0) {
if (this.items[i].name != 'Aged Brie') {
if (this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
}
}
} else {
this.items[i].quality = this.items[i].quality - this.items[i].quality
}
} else {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
}
}
}
}
return this.items;
}
}

View File

@ -1,44 +0,0 @@
{
"name": "typescript-mocha-kata-seed",
"version": "1.4.0",
"description": "Seed project for TDD code katas on TypeScript and mocha",
"main": "index.js",
"scripts": {
"precompile": "rimraf app/**/*.js test/**/*.js",
"compile": "tsc",
"pretest": "rimraf app/**/*.js test/**/*.js",
"test": "nyc mocha"
},
"author": "paucls",
"homepage": "https://github.com/paucls/typescript-mocha-kata-seed",
"license": "ISC",
"private": true,
"devDependencies": {
"@types/chai": "~3.5.2",
"@types/mocha": "~2.2.41",
"@types/node": "~7.0.18",
"chai": "~3.5.0",
"mocha": "~3.2.0",
"nyc": "~11.0.3",
"rimraf": "~2.5.2",
"ts-node": "~3.1.0",
"typescript": "~2.2.0"
},
"nyc": {
"extension": [
".ts"
],
"exclude": [
"**/*.d.ts",
"test/**"
],
"require": [
"ts-node/register"
],
"reporter": [
"html",
"text"
]
}
}

View File

@ -1,12 +0,0 @@
import { expect } from 'chai';
import { Item, GildedRose } from '../app/gilded-rose';
describe('Gilded Rose', function () {
it('should foo', function() {
const gildedRose = new GildedRose([ new Item('foo', 0, 0) ]);
const items = gildedRose.updateQuality();
expect(items[0].name).to.equal('fixme');
});
});

View File

@ -1,4 +0,0 @@
--compilers ts-node/register
--require source-map-support/register
--recursive
test/**/*.ts

View File

@ -1,11 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"sourceMap": false
},
"exclude": [
"node_modules"
]
}

View File

@ -1,16 +0,0 @@
# Gilded Rose Refactoring Kata in [ABAP](http://scn.sap.com/community/abap/)
## Prerequisite
Access to SAP NetWeaver server with at least ABAP 7.40
## Installation
Assuming you have a proper developer key set up, run SE38
* create a new Module Pool (type M) program as a Local Object
* paste the raw code from [YY_PAO_GILDED_ROSE.abap](https://raw.githubusercontent.com/brehberg/GildedRose-Refactoring-Kata/master/abap/YY_PAO_GILDED_ROSE.abap)
* save (Ctrl-S) and activate (Ctrl-F3) the program
## Running Tests
From the menus choose Program -> Execute -> Unit Tests (Ctrl+Shift+F10)

View File

@ -1,242 +0,0 @@
*&---------------------------------------------------------------------*
*& Gilded Rose Requirements Specification
*&---------------------------------------------------------------------*
*&
*& Hi and welcome to team Gilded Rose. As you know, we are a small inn with
*& a prime location in a prominent city ran by a friendly innkeeper named
*& Allison. We also buy and sell only the finest goods. Unfortunately, our
*& goods are constantly degrading in quality as they approach their sell by
*& date. We have a system in place that updates our inventory for us. It
*& was developed by a no-nonsense type named Leeroy, who has moved on to
*& new adventures. Your task is to add the new feature to our system so that
*& we can begin selling a new category of items.
*&
*& First an introduction to our system:
*&
*& - All items have a Sell In value which denotes the number of
*& days we have to sell the item
*& - All items have a Quality value which denotes how valuable the item is
*& - At the end of each day our system lowers both values for every item
*&
*& Seems pretty simple, right? Well this is where it gets interesting:
*&
*& - Once the sell by date has passed, Quality degrades twice as fast
*& - The Quality of an item is never negative
*& - "Aged Brie" actually increases in Quality the older it gets
*& - The Quality of an item is never more than 50
*& - "Sulfuras", being a legendary item, never has to be sold or
*& decreases in Quality
*& - "Backstage passes", like aged brie, increases in Quality as its
*& Sell In value approaches; Quality increases by 2 when there
*& are 10 days or less and by 3 when there are 5 days or less
*& but Quality drops to 0 after the concert
*&
*& We have recently signed a supplier of conjured items. This requires an
*& update to our system:
*&
*& - "Conjured" items degrade in Quality twice as fast as normal items
*&
*& Feel free to make any changes to the Update Quality method and add any new
*& code as long as everything still works correctly. However, do not alter
*& the Item class directly or Items table attribute as those belong to the
*& goblin in the corner who will insta-rage and one-shot you as he doesn't
*& believe in shared code ownership (you can make the Update Quality method
*& and Items property static if you must, we'll cover for you).
*&
*& Just for clarification, an item can never have its Quality increase
*& above 50, however "Sulfuras" is a legendary item and as such its Quality
*& is 80 and it never alters.
PROGRAM yy_pao_gilded_rose.
*& Production Code - Class Library
CLASS lcl_item DEFINITION DEFERRED.
CLASS lcl_gilded_rose DEFINITION FINAL.
PUBLIC SECTION.
TYPES:
tt_items TYPE STANDARD TABLE OF REF TO lcl_item WITH EMPTY KEY.
METHODS:
constructor
IMPORTING it_items TYPE tt_items,
update_quality.
PRIVATE SECTION.
DATA:
mt_items TYPE tt_items.
ENDCLASS.
CLASS lcl_item DEFINITION FINAL.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING iv_name TYPE string
iv_sell_in TYPE i
iv_quality TYPE i,
description
RETURNING VALUE(rv_string) TYPE string.
DATA:
mv_name TYPE string,
mv_sell_in TYPE i,
mv_quality TYPE i.
ENDCLASS.
CLASS lcl_gilded_rose IMPLEMENTATION.
METHOD constructor.
mt_items = it_items.
ENDMETHOD.
METHOD update_quality.
LOOP AT mt_items INTO DATA(lo_item).
IF lo_item->mv_name <> |Aged Brie| AND
lo_item->mv_name <> |Backstage passes to a TAFKAL80ETC concert|.
IF lo_item->mv_quality > 0.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
lo_item->mv_quality = lo_item->mv_quality - 1.
ENDIF.
ENDIF.
ELSE.
IF lo_item->mv_quality < 50.
lo_item->mv_quality = lo_item->mv_quality + 1.
IF lo_item->mv_name = |Backstage passes to a TAFKAL80ETC concert|.
IF lo_item->mv_sell_in < 11.
IF lo_item->mv_quality < 50.
lo_item->mv_quality = lo_item->mv_quality + 1.
ENDIF.
ENDIF.
IF lo_item->mv_sell_in < 6.
IF lo_item->mv_quality < 50.
lo_item->mv_quality = lo_item->mv_quality + 1.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
lo_item->mv_sell_in = lo_item->mv_sell_in - 1.
ENDIF.
IF lo_item->mv_sell_in < 0.
IF lo_item->mv_name <> |Aged Brie|.
IF lo_item->mv_name <> |Backstage passes to a TAFKAL80ETC concert|.
IF lo_item->mv_quality > 0.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
lo_item->mv_quality = lo_item->mv_quality - 1.
ENDIF.
ENDIF.
ELSE.
lo_item->mv_quality = lo_item->mv_quality - lo_item->mv_quality.
ENDIF.
ELSE.
IF lo_item->mv_quality < 50.
lo_item->mv_quality = lo_item->mv_quality + 1.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
CLASS lcl_item IMPLEMENTATION.
METHOD constructor.
mv_name = iv_name.
mv_sell_in = iv_sell_in.
mv_quality = iv_quality.
ENDMETHOD.
METHOD description.
rv_string = |{ mv_name }, { mv_sell_in }, { mv_quality }|.
ENDMETHOD.
ENDCLASS.
*& Test Code - Executable Text Test Fixture
CLASS lth_texttest_fixture DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS lth_texttest_fixture IMPLEMENTATION.
METHOD main.
DATA(lo_out) = cl_demo_output=>new( )->write_text( |OMGHAI!| ).
DATA(lt_items) = VALUE lcl_gilded_rose=>tt_items(
( NEW #( iv_name = |+5 Dexterity Vest|
iv_sell_in = 10
iv_quality = 20 ) )
( NEW #( iv_name = |Aged Brie|
iv_sell_in = 2
iv_quality = 0 ) )
( NEW #( iv_name = |Elixir of the Mongoose|
iv_sell_in = 5
iv_quality = 7 ) )
( NEW #( iv_name = |Sulfuras, Hand of Ragnaros|
iv_sell_in = 0
iv_quality = 80 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
iv_sell_in = 15
iv_quality = 20 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
iv_sell_in = 10
iv_quality = 49 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
iv_sell_in = 5
iv_quality = 49 ) )
"This conjured item does not work properly yet
( NEW #( iv_name = |Conjured Mana Cake|
iv_sell_in = 3
iv_quality = 6 ) ) ).
DATA(lo_app) = NEW lcl_gilded_rose( it_items = lt_items ).
DATA(lv_days) = 2.
cl_demo_input=>request( EXPORTING text = |Number of Days?|
CHANGING field = lv_days ).
DO lv_days TIMES.
lo_out->next_section( |-------- day { sy-index } --------| ).
lo_out->write_text( |Name, Sell_In, Quality| ).
LOOP AT lt_items INTO DATA(lo_item).
lo_out->write_text( lo_item->description( ) ).
ENDLOOP.
lo_app->update_quality( ).
ENDDO.
lo_out->display( ).
ENDMETHOD.
ENDCLASS.
*& Test Code - Currently Broken
CLASS ltc_gilded_rose DEFINITION FINAL FOR TESTING RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS:
foo FOR TESTING.
ENDCLASS.
CLASS ltc_gilded_rose IMPLEMENTATION.
METHOD foo.
DATA(lt_items) = VALUE lcl_gilded_rose=>tt_items( ( NEW #( iv_name = |foo|
iv_sell_in = 0
iv_quality = 0 ) ) ).
DATA(lo_app) = NEW lcl_gilded_rose( it_items = lt_items ).
lo_app->update_quality( ).
cl_abap_unit_assert=>assert_equals(
act = CAST lcl_item( lt_items[ 1 ] )->mv_name
exp = |fixme| ).
ENDMETHOD.
ENDCLASS.

22
build.gradle Normal file
View File

@ -0,0 +1,22 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
}
version '1.0.0'
repositories {
mavenCentral()
}
dependencies {
compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71'
testCompile 'junit:junit:4.12'
testCompile "org.assertj:assertj-core:3.8.0"
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}

View File

@ -1,90 +0,0 @@
#include <string.h>
#include "GildedRose.h"
Item*
init_item(Item* item, const char *name, int sellIn, int quality)
{
item->sellIn = sellIn;
item->quality = quality;
item->name = strdup(name);
return item;
}
void update_quality(Item items[], int size)
{
int i;
for (i = 0; i < size; i++)
{
if (strcmp(items[i].name, "Aged Brie") && strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
if (!strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].sellIn < 11)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
if (items[i].sellIn < 6)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (strcmp(items[i].name, "Aged Brie"))
{
if (strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
items[i].quality = items[i].quality - items[i].quality;
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}

View File

@ -1,9 +0,0 @@
typedef struct
{
char *name;
int sellIn;
int quality;
} Item;
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
extern void update_quality(Item items[], int size);

View File

@ -1,43 +0,0 @@
#include <stdio.h>
#include "GildedRose.h"
int
print_item(Item *item)
{
return printf("%s, %d, %d\n", item->name, item->sellIn, item->quality);
}
int main()
{
Item items[9];
int last = 0;
int day;
int index;
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
init_item(items + last++, "Aged Brie", 2, 0);
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", -1, 80);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 10, 49);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 5, 49);
// this Conjured item doesn't yet work properly
init_item(items + last++, "Conjured Mana Cake", 3, 6);
puts("OMGHAI!");
for (day = 0; day <= 30; day++)
{
printf("-------- day %d --------\n", day);
printf("name, sellIn, quality\n");
for(index = 0; index < last; index++) {
print_item(items + index);
}
printf("\n");
update_quality(items, last);
}
return 0;
}

View File

@ -1,51 +0,0 @@
# Makefile for building the kata file with the Google Testing Framework
#
# SYNOPSIS:
#
# make [all] - makes everything, runs tests
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# make memtest - run memory leak analysis
# The _POSIX_C_SOURCE definition prevents the compiler from throwing warnings
CFLAGS = `pkg-config --cflags check` -g --std=c99 -D_POSIX_C_SOURCE=200809L
LIBS = `pkg-config --libs check`
# All files that should be part of your test should start with 'test_'
TEST_SRC = $(wildcard test_*.c)
TEST_BASE = $(basename ${TEST_SRC})
TEST_OBJECTS = $(addsuffix .o, ${TEST_BASE})
# All files that should be part of your main program should start with 'gilded_'
PROG_SRC = $(wildcard gilded_*.c)
PROG_BASE = $(basename ${PROG_SRC})
PROG_OBJECTS = $(addsuffix .o, ${PROG_BASE})
OBJECT_UNDER_TEST = GildedRose.o ${PROG_OBJECTS}
# This is the test application. You can run this program to see your test output
TEST_APP = test_gildedrose
# This will generate output for several products over a course of several days.
# You can run this application to build golden rule tests
GOLDEN_APP = golden_rose
all: ${TEST_APP} ${GOLDEN_APP}
./${TEST_APP}
${TEST_APP}: ${TEST_OBJECTS} ${OBJECT_UNDER_TEST}
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
${GOLDEN_APP}: GildedRoseTextTests.o ${OBJECT_UNDER_TEST}
$(CC) $(CFLAGS) -o $@ $^
# If you're not on a mac, you should run memtest (in fact, consider adding it to the 'all' target).
# If you're on a mac, complain to apple for breaking an important development tool.
memtest: ${TEST_APP}
valgrind --leak-check=full --error-exitcode=1 ./${TEST_APP} --nofork
clean:
rm -f *.o
rm -f ${TEST_APP}
rm -f ${GOLDEN_APP}

View File

@ -1,41 +0,0 @@
# Gilded Rose, C99 Edition
The command "make" will build and run your tests, as well as build the program
golden_rose, which can serve as the basis for a golden-rule test.
## Assumptions
- gnu make and a C compiler (like gcc) is installed on your system and is in the PATH
- The check unit testing library is installed on your system (https://libcheck.github.io/check/)
- pkg-config is installed on your system
## Usage
- Run `make` to build the program and run all tests
- Files which contain tests should be named `test_*.c` They will automatically
be included in your test suite.
- `GildedRose.h` should not be modified. The Goblin threat is real.
- New program logic may be included in files named `gilded_*.c` which will
automatically be included in both your tests and the final program.
## Golden Rule tests
- The program `golden_rose` will generate text output. If you capture this
output after your first `make` you can use this as a reference for a golden
rule test.
- You can test your work against this reference by directing the output of your
current golden_rose to a file and using the `diff` utility to compare that
to the reference file you created above.
- To avoid the Goblin threat you can use `git diff GildedRose.h`, which should
have no output if you have left the precious Item structure unchanged.
## Notes
- This project is tweaked to run on Linux systems, and will mostly work on Macs.
With some changes to the Makefile it can be made to run on BSD systems with
BSD make. An adventurous person could also get it to run on Windows.
- If you are working on a Macintosh computer you cannot run the memtest target,
because valgrind and OS X don't play nice any more. If you want to use the
memory checker OS X does run docker as a first class citizen.
- If you don't have pkg-config on your system, the only changes you'll need to
make are for the requirements of the check library. Mostly you need to
set the appropriate flags for threaded binaries, which may include some
special linker flags. The libcheck documentation will cover what you need
if you want to undertake this change.

View File

@ -1,31 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <check.h>
Suite *suite_rose(void);
int main(int argc, char **argv)
{
Suite *s;
SRunner *runner;
int number_fails;
int forkme = 1;
if (argc > 1 && strcmp(argv[1], "--nofork") == 0) {
forkme = 0;
}
s = suite_rose();
runner = srunner_create(s);
if (0 == forkme) {
srunner_set_fork_status(runner, CK_NOFORK);
}
srunner_run_all(runner, CK_NORMAL);
number_fails = srunner_ntests_failed(runner);
srunner_free(runner);
return number_fails;
}

View File

@ -1,34 +0,0 @@
#include <check.h>
#include "GildedRose.h"
START_TEST(roseFoo)
{
Item items[1];
init_item(items, "foo", 0, 0);
update_quality(items, 1);
ck_assert_str_eq("fixme", items[0].name);
}
END_TEST
TCase *tcase_rose(void)
{
TCase *tc;
tc = tcase_create("gilded-rose");
tcase_add_test(tc, roseFoo);
return tc;
}
Suite *suite_rose(void)
{
Suite *s;
s = suite_create("characterization-tests");
suite_add_tcase(s, tcase_rose());
return s;
}

View File

@ -1,140 +0,0 @@
; Hi and welcome to team Gilded Rose. As you know, we are a small inn
; with a prime location in a prominent city ran by a friendly
; innkeeper named Allison. We also buy and sell only the finest goods.
; Unfortunately, our goods are constantly degrading in quality as they
; approach their sell by date. We have a system in place that updates
; our inventory for us. It was developed by a no-nonsense type named
; Leeroy, who has moved on to new adventures. Your task is to add the
; new feature to our system so that we can begin selling a new
; category of items.
; First an introduction to our system:
; All items have a SellIn value which denotes the number of days we have to sell the item
; All items have a Quality value which denotes how valuable the item is
; At the end of each day our system lowers both values for every item
; Pretty simple, right? Well this is where it gets interesting:
; Once the sell by date has passed, Quality degrades twice as fast
; The Quality of an item is never negative
; "Aged Brie" actually increases in Quality the older it gets
; The Quality of an item is never more than 50
; "Sulfuras", being a legendary item, never has to be sold or decreases in Quality
; "Backstage passes", like aged brie, increases in Quality as it's
; SellIn value approaches; Quality increases by 2 when there are 10
; days or less and by 3 when there are 5 days or less but Quality
; drops to 0 after the concert
; We have recently signed a supplier of conjured items. This requires an update to our system:
; "Conjured" items degrade in Quality twice as fast as normal items
; Feel free to make any changes to the UpdateQuality method and add
; any new code as long as everything still works correctly. However,
; do not alter the Item class or Items property as those belong to the
; goblin in the corner who will insta-rage and one-shot you as he
; doesn't believe in shared code ownership (you can make the
; UpdateQuality method and Items property static if you like, we'll
; cover for you).
; Just for clarification, an item can never have its Quality increase
; above 50, however "Sulfuras" is a legendary item and as such its
; Quality is 80 and it never alters.
; https://github.com/emilybache/GildedRose-Refactoring-Kata
; Common Lisp version: Rainer Joswig, joswig@lisp.de, 2016
; Example from the command line:
; sbcl --script gildedrose.lisp 10
;;; ================================================================
;;; Code
(defpackage "GILDED-ROSE"
(:use "CL"))
(in-package "GILDED-ROSE")
;;; Class ITEM
(defclass item ()
((name :initarg :name :type string)
(sell-in :initarg :sell-in :type integer)
(quality :initarg :quality :type integer)))
(defmethod to-string ((i item))
(with-slots (name quality sell-in) i
(format nil "~a, ~a, ~a" name sell-in quality)))
;;; Class GILDED-ROSE
(defclass gilded-rose ()
((items :initarg :items)))
(defmethod update-quality ((gr gilded-rose))
(with-slots (items) gr
(dotimes (i (length items))
(with-slots (name quality sell-in)
(elt items i)
(if (and (not (equalp name "Aged Brie"))
(not (equalp name "Backstage passes to a TAFKAL80ETC concert")))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(setf quality (- quality 1))))
(when (< quality 50)
(setf quality (+ quality 1))
(when (equalp name "Backstage passes to a TAFKAL80ETC concert")
(if (< sell-in 11)
(if (< quality 50)
(setf quality (+ quality 1))))
(if (< sell-in 6)
(if (< quality 50)
(setf quality (+ quality 1)))))))
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(setf sell-in (- sell-in 1)))
(if (< sell-in 0)
(if (not (equalp name "Aged Brie"))
(if (not (equalp name "Backstage passes to a TAFKAL80ETC concert"))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(setf quality (- quality 1))))
(setf quality (- quality quality)))
(if (< quality 50)
(setf quality (+ quality 1)))))))))
;;; Example
(defun run-gilded-rose ()
(write-line "OMGHAI!")
(let* ((descriptions '(("+5 Dexterity Vest" 10 20)
("Aged Brie" 2 0)
("Elixir of the Mongoose" 5 7)
("Sulfuras, Hand of Ragnaros" 0 80)
("Sulfuras, Hand of Ragnaros" -1 80)
("Backstage passes to a TAFKAL80ETC concert" 15 20)
("Backstage passes to a TAFKAL80ETC concert" 10 49)
("Backstage passes to a TAFKAL80ETC concert" 5 49)
;; this conjured item does not work properly yet
("Conjured Mana Cake" 3 6)))
(items (loop for (name sell-in quality) in descriptions
collect (make-instance 'item
:name name
:sell-in sell-in
:quality quality)))
(app (make-instance 'gilded-rose :items items))
(days 2))
#+sbcl
(if (second sb-ext:*posix-argv*)
(setf days (parse-integer (second sb-ext:*posix-argv*))))
#+lispworks
(if (fourth sys:*line-arguments-list*)
(setf days (parse-integer (fourth sys:*line-arguments-list*))))
(dotimes (i days)
(format t "-------- day ~a --------~%" i)
(format t "name, sell-in, quality~%")
(dolist (item items)
(write-line (to-string item)))
(terpri)
(update-quality app))))
(run-gilded-rose)
;;; ================================================================
;;; EOF

View File

@ -1,30 +0,0 @@
cmake_minimum_required(VERSION 2.8.4)
project(cpp)
# CMake FindThreads is broken until 3.1
#find_package(Threads REQUIRED)
set(CMAKE_THREAD_LIBS_INIT pthread)
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
set(GILDED_ROSE_SOURCE_FILES
GildedRose.cc
GildedRose.h
GildedRoseUnitTests.cc)
set(GILDED_ROSE_TEXT_TESTS_SOURCE_FILES
GildedRose.cc
GildedRose.h
GildedRoseTextTests.cc)
set(SOURCE_FILES
${GILDED_ROSE_SOURCE_FILES}
${GILDED_ROSE_TEXT_TESTS_SOURCE_FILES})
add_executable(GildedRose ${GILDED_ROSE_SOURCE_FILES})
target_link_libraries(GildedRose ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_executable(GildedRoseTextTests ${GILDED_ROSE_TEXT_TESTS_SOURCE_FILES})
target_link_libraries(GildedRoseTextTests ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

View File

@ -1,80 +0,0 @@
#include "GildedRose.h"
GildedRose::GildedRose(vector<Item> & items) : items(items)
{}
void GildedRose::updateQuality()
{
for (int i = 0; i < items.size(); i++)
{
if (items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert")
{
if (items[i].sellIn < 11)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
if (items[i].sellIn < 6)
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros")
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (items[i].name != "Aged Brie")
{
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
{
items[i].quality = items[i].quality - 1;
}
}
}
else
{
items[i].quality = items[i].quality - items[i].quality;
}
}
else
{
if (items[i].quality < 50)
{
items[i].quality = items[i].quality + 1;
}
}
}
}
}

View File

@ -1,24 +0,0 @@
#include <string>
#include <vector>
using namespace std;
class Item
{
public:
string name;
int sellIn;
int quality;
Item(string name, int sellIn, int quality) : name(name), sellIn(sellIn), quality(quality)
{}
};
class GildedRose
{
public:
vector<Item> & items;
GildedRose(vector<Item> & items);
void updateQuality();
};

View File

@ -1,42 +0,0 @@
#include "GildedRose.h"
#include <iostream>
using namespace std;
ostream& operator<<(ostream& s, Item& item)
{
s << item.name << ", " << item.sellIn << ", " << item.quality;
return s;
}
int main()
{
vector<Item> items;
items.push_back(Item("+5 Dexterity Vest", 10, 20));
items.push_back(Item("Aged Brie", 2, 0));
items.push_back(Item("Elixir of the Mongoose", 5, 7));
items.push_back(Item("Sulfuras, Hand of Ragnaros", 0, 80));
items.push_back(Item("Sulfuras, Hand of Ragnaros", -1, 80));
items.push_back(Item("Backstage passes to a TAFKAL80ETC concert", 15, 20));
items.push_back(Item("Backstage passes to a TAFKAL80ETC concert", 10, 49));
items.push_back(Item("Backstage passes to a TAFKAL80ETC concert", 5, 49));
// this Conjured item doesn't yet work properly
items.push_back(Item("Conjured Mana Cake", 3, 6));
GildedRose app(items);
cout << "OMGHAI!" << endl;
for (int day = 0; day <= 30; day++)
{
cout << "-------- day " << day << " --------" << endl;
cout << "name, sellIn, quality" << endl;
for (vector<Item>::iterator i = items.begin(); i != items.end(); i++)
{
cout << *i << endl;
}
cout << endl;
app.updateQuality();
}
}

View File

@ -1,24 +0,0 @@
#include <gtest/gtest.h>
#include "GildedRose.h"
TEST(GildedRoseTest, Foo) {
vector<Item> items;
items.push_back(Item("Foo", 0, 0));
GildedRose app(items);
app.updateQuality();
EXPECT_EQ("fixme", app.items[0].name);
}
void example()
{
vector<Item> items;
items.push_back(Item("+5 Dexterity Vest", 10, 20));
items.push_back(Item("Aged Brie", 2, 0));
items.push_back(Item("Elixir of the Mongoose", 5, 7));
items.push_back(Item("Sulfuras, Hand of Ragnaros", 0, 80));
items.push_back(Item("Backstage passes to a TAFKAL80ETC concert", 15, 20));
items.push_back(Item("Conjured Mana Cake", 3, 6));
GildedRose app(items);
app.updateQuality();
}

View File

@ -1,85 +0,0 @@
# Makefile for building the kata file with the Google Testing Framework
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# Please tweak the following variable definitions as needed by your
# project, except GTEST_HEADERS, which you can use in your own targets
# but shouldn't modify.
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file.
GTEST_DIR = gtest
# Where to find user code.
USER_DIR = .
# Flags passed to the preprocessor.
CPPFLAGS += -I$(GTEST_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = GildedRose
TEXTTESTS = GildedRoseTextTests
# All Google Test headers. Usually you shouldn't change this
# definition.
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
$(GTEST_DIR)/include/gtest/internal/*.h
# House-keeping build targets.
all : $(TESTS) $(TEXTTESTS)
clean :
rm -f $(TESTS) $(TEXTTESTS) gtest.a gtest_main.a *.o
# Builds gtest.a and gtest_main.a.
# Usually you shouldn't tweak such internal variables, indicated by a
# trailing _.
GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
# For simplicity and to avoid depending on Google Test's
# implementation details, the dependencies specified below are
# conservative and not optimized. This is fine as Google Test
# compiles fast and for ordinary users its source rarely changes.
gtest-all.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
$(GTEST_DIR)/src/gtest-all.cc
gtest_main.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
$(GTEST_DIR)/src/gtest_main.cc
gtest.a : gtest-all.o
$(AR) $(ARFLAGS) $@ $^
gtest_main.a : gtest-all.o gtest_main.o
$(AR) $(ARFLAGS) $@ $^
# Builds a sample test. A test should link with gtest.a, and also
# gtest_main.a if it doesn't define its own main() function.
GildedRose.o : $(USER_DIR)/GildedRose.cc
$(CXX) -c $^
GildedRoseUnitTests.o : $(USER_DIR)/GildedRoseUnitTests.cc \
$(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/GildedRoseUnitTests.cc
GildedRose : GildedRoseUnitTests.o GildedRose.o gtest.a gtest_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -pthread $^ -o $@
GildedRoseTextTests.o : $(USER_DIR)/GildedRoseTextTests.cc
$(CXX) -c $^
GildedRoseTextTests : GildedRoseTextTests.o GildedRose.o
$(CXX) -pthread $^ -o $@

View File

@ -1,38 +0,0 @@
TL;DR;
-------
run-once.sh runs your tests once
Before this will work you will need:
- make and a C++ compiler (like gcc) is installed on your system and is in the PATH
- The GTest framework in the directory gtest.
- If your IDE does the compilation and linking, you should remove the first 3 lines
in the run-once.sh file.
More Verbose Instructions
-------------------------
Create a clone of both GildedRose-Refactoring-Kata and googletest in a directory we'll call ${ROOT_INSTALL_DIR}:
cd ${ROOT_INSTALL_DIR}
git clone https://github.com/emilybache/GildedRose-Refactoring-Kata
git clone https://github.com/google/googletest
Make googletest by running make in subfolder googletest/googletest/make:
cd googletest/googletest/make
make
Create a softlink in the GildedRose-Refactoring-Kata clone pointing at the googletest code:
cd ${ROOT_INSTALL_DIR}/GildedRose-Refactoring-Kata/cpp
ln -s ${ROOT_INSTALL_DIR}/googletest/googletest gtest
Make the GildedRose-Refactoring-Kata:
make
Then you should be able to run the tests:
./run_once.sh
If you have been successful, then you should see a failing test, "GildedRoseTest.Foo".

View File

@ -1,4 +0,0 @@
rm GildedRose
rm GildedRose.o
make
./GildedRose

299
csharp/.gitignore vendored
View File

@ -1,299 +0,0 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@ -1,30 +0,0 @@
using System;
using System.IO;
using System.Text;
using NUnit.Framework;
namespace csharp
{
[TestFixture]
public class ApprovalTest
{
[Test]
public void ThirtyDays()
{
var lines = File.ReadAllLines("ThirtyDays.txt");
StringBuilder fakeoutput = new StringBuilder();
Console.SetOut(new StringWriter(fakeoutput));
Console.SetIn(new StringReader("a\n"));
Program.Main(new string[] { });
String output = fakeoutput.ToString();
var outputLines = output.Split('\n');
for(var i = 0; i<Math.Min(lines.Length, outputLines.Length); i++)
{
Assert.AreEqual(lines[i], outputLines[i]);
}
}
}
}

View File

@ -1,89 +0,0 @@
using System.Collections.Generic;
namespace csharp
{
public class GildedRose
{
IList<Item> Items;
public GildedRose(IList<Item> Items)
{
this.Items = Items;
}
public void UpdateQuality()
{
for (var i = 0; i < Items.Count; i++)
{
if (Items[i].Name != "Aged Brie" && Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
{
Items[i].Quality = Items[i].Quality - 1;
}
}
}
else
{
if (Items[i].Quality < 50)
{
Items[i].Quality = Items[i].Quality + 1;
if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
{
if (Items[i].SellIn < 11)
{
if (Items[i].Quality < 50)
{
Items[i].Quality = Items[i].Quality + 1;
}
}
if (Items[i].SellIn < 6)
{
if (Items[i].Quality < 50)
{
Items[i].Quality = Items[i].Quality + 1;
}
}
}
}
}
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
{
Items[i].SellIn = Items[i].SellIn - 1;
}
if (Items[i].SellIn < 0)
{
if (Items[i].Name != "Aged Brie")
{
if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
{
Items[i].Quality = Items[i].Quality - 1;
}
}
}
else
{
Items[i].Quality = Items[i].Quality - Items[i].Quality;
}
}
else
{
if (Items[i].Quality < 50)
{
Items[i].Quality = Items[i].Quality + 1;
}
}
}
}
}
}
}

View File

@ -1,18 +0,0 @@
using NUnit.Framework;
using System.Collections.Generic;
namespace csharp
{
[TestFixture]
public class GildedRoseTest
{
[Test]
public void foo()
{
IList<Item> Items = new List<Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } };
GildedRose app = new GildedRose(Items);
app.UpdateQuality();
Assert.AreEqual("fixme", Items[0].Name);
}
}
}

View File

@ -1,14 +0,0 @@
namespace csharp
{
public class Item
{
public string Name { get; set; }
public int SellIn { get; set; }
public int Quality { get; set; }
public override string ToString()
{
return this.Name + ", " + this.SellIn + ", " + this.Quality;
}
}
}

View File

@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
namespace csharp
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("OMGHAI!");
IList<Item> Items = new List<Item>{
new Item {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
new Item {Name = "Aged Brie", SellIn = 2, Quality = 0},
new Item {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = -1, Quality = 80},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 15,
Quality = 20
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 10,
Quality = 49
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
};
var app = new GildedRose(Items);
for (var i = 0; i < 31; i++)
{
Console.WriteLine("-------- day " + i + " --------");
Console.WriteLine("name, sellIn, quality");
for (var j = 0; j < Items.Count; j++)
{
System.Console.WriteLine(Items[j]);
}
Console.WriteLine("");
app.UpdateQuality();
}
}
}
}

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("csharp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("176c0214-9136-4079-8dab-11d7420c3881")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,373 +0,0 @@
OMGHAI!
-------- day 0 --------
name, sellIn, quality
+5 Dexterity Vest, 10, 20
Aged Brie, 2, 0
Elixir of the Mongoose, 5, 7
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 15, 20
Backstage passes to a TAFKAL80ETC concert, 10, 49
Backstage passes to a TAFKAL80ETC concert, 5, 49
Conjured Mana Cake, 3, 6
-------- day 1 --------
name, sellIn, quality
+5 Dexterity Vest, 9, 19
Aged Brie, 1, 1
Elixir of the Mongoose, 4, 6
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 14, 21
Backstage passes to a TAFKAL80ETC concert, 9, 50
Backstage passes to a TAFKAL80ETC concert, 4, 50
Conjured Mana Cake, 2, 5
-------- day 2 --------
name, sellIn, quality
+5 Dexterity Vest, 8, 18
Aged Brie, 0, 2
Elixir of the Mongoose, 3, 5
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 13, 22
Backstage passes to a TAFKAL80ETC concert, 8, 50
Backstage passes to a TAFKAL80ETC concert, 3, 50
Conjured Mana Cake, 1, 4
-------- day 3 --------
name, sellIn, quality
+5 Dexterity Vest, 7, 17
Aged Brie, -1, 4
Elixir of the Mongoose, 2, 4
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 12, 23
Backstage passes to a TAFKAL80ETC concert, 7, 50
Backstage passes to a TAFKAL80ETC concert, 2, 50
Conjured Mana Cake, 0, 3
-------- day 4 --------
name, sellIn, quality
+5 Dexterity Vest, 6, 16
Aged Brie, -2, 6
Elixir of the Mongoose, 1, 3
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 11, 24
Backstage passes to a TAFKAL80ETC concert, 6, 50
Backstage passes to a TAFKAL80ETC concert, 1, 50
Conjured Mana Cake, -1, 1
-------- day 5 --------
name, sellIn, quality
+5 Dexterity Vest, 5, 15
Aged Brie, -3, 8
Elixir of the Mongoose, 0, 2
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 10, 25
Backstage passes to a TAFKAL80ETC concert, 5, 50
Backstage passes to a TAFKAL80ETC concert, 0, 50
Conjured Mana Cake, -2, 0
-------- day 6 --------
name, sellIn, quality
+5 Dexterity Vest, 4, 14
Aged Brie, -4, 10
Elixir of the Mongoose, -1, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 9, 27
Backstage passes to a TAFKAL80ETC concert, 4, 50
Backstage passes to a TAFKAL80ETC concert, -1, 0
Conjured Mana Cake, -3, 0
-------- day 7 --------
name, sellIn, quality
+5 Dexterity Vest, 3, 13
Aged Brie, -5, 12
Elixir of the Mongoose, -2, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 8, 29
Backstage passes to a TAFKAL80ETC concert, 3, 50
Backstage passes to a TAFKAL80ETC concert, -2, 0
Conjured Mana Cake, -4, 0
-------- day 8 --------
name, sellIn, quality
+5 Dexterity Vest, 2, 12
Aged Brie, -6, 14
Elixir of the Mongoose, -3, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 7, 31
Backstage passes to a TAFKAL80ETC concert, 2, 50
Backstage passes to a TAFKAL80ETC concert, -3, 0
Conjured Mana Cake, -5, 0
-------- day 9 --------
name, sellIn, quality
+5 Dexterity Vest, 1, 11
Aged Brie, -7, 16
Elixir of the Mongoose, -4, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 6, 33
Backstage passes to a TAFKAL80ETC concert, 1, 50
Backstage passes to a TAFKAL80ETC concert, -4, 0
Conjured Mana Cake, -6, 0
-------- day 10 --------
name, sellIn, quality
+5 Dexterity Vest, 0, 10
Aged Brie, -8, 18
Elixir of the Mongoose, -5, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 5, 35
Backstage passes to a TAFKAL80ETC concert, 0, 50
Backstage passes to a TAFKAL80ETC concert, -5, 0
Conjured Mana Cake, -7, 0
-------- day 11 --------
name, sellIn, quality
+5 Dexterity Vest, -1, 8
Aged Brie, -9, 20
Elixir of the Mongoose, -6, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 4, 38
Backstage passes to a TAFKAL80ETC concert, -1, 0
Backstage passes to a TAFKAL80ETC concert, -6, 0
Conjured Mana Cake, -8, 0
-------- day 12 --------
name, sellIn, quality
+5 Dexterity Vest, -2, 6
Aged Brie, -10, 22
Elixir of the Mongoose, -7, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 3, 41
Backstage passes to a TAFKAL80ETC concert, -2, 0
Backstage passes to a TAFKAL80ETC concert, -7, 0
Conjured Mana Cake, -9, 0
-------- day 13 --------
name, sellIn, quality
+5 Dexterity Vest, -3, 4
Aged Brie, -11, 24
Elixir of the Mongoose, -8, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 2, 44
Backstage passes to a TAFKAL80ETC concert, -3, 0
Backstage passes to a TAFKAL80ETC concert, -8, 0
Conjured Mana Cake, -10, 0
-------- day 14 --------
name, sellIn, quality
+5 Dexterity Vest, -4, 2
Aged Brie, -12, 26
Elixir of the Mongoose, -9, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 1, 47
Backstage passes to a TAFKAL80ETC concert, -4, 0
Backstage passes to a TAFKAL80ETC concert, -9, 0
Conjured Mana Cake, -11, 0
-------- day 15 --------
name, sellIn, quality
+5 Dexterity Vest, -5, 0
Aged Brie, -13, 28
Elixir of the Mongoose, -10, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, 0, 50
Backstage passes to a TAFKAL80ETC concert, -5, 0
Backstage passes to a TAFKAL80ETC concert, -10, 0
Conjured Mana Cake, -12, 0
-------- day 16 --------
name, sellIn, quality
+5 Dexterity Vest, -6, 0
Aged Brie, -14, 30
Elixir of the Mongoose, -11, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -1, 0
Backstage passes to a TAFKAL80ETC concert, -6, 0
Backstage passes to a TAFKAL80ETC concert, -11, 0
Conjured Mana Cake, -13, 0
-------- day 17 --------
name, sellIn, quality
+5 Dexterity Vest, -7, 0
Aged Brie, -15, 32
Elixir of the Mongoose, -12, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -2, 0
Backstage passes to a TAFKAL80ETC concert, -7, 0
Backstage passes to a TAFKAL80ETC concert, -12, 0
Conjured Mana Cake, -14, 0
-------- day 18 --------
name, sellIn, quality
+5 Dexterity Vest, -8, 0
Aged Brie, -16, 34
Elixir of the Mongoose, -13, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -3, 0
Backstage passes to a TAFKAL80ETC concert, -8, 0
Backstage passes to a TAFKAL80ETC concert, -13, 0
Conjured Mana Cake, -15, 0
-------- day 19 --------
name, sellIn, quality
+5 Dexterity Vest, -9, 0
Aged Brie, -17, 36
Elixir of the Mongoose, -14, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -4, 0
Backstage passes to a TAFKAL80ETC concert, -9, 0
Backstage passes to a TAFKAL80ETC concert, -14, 0
Conjured Mana Cake, -16, 0
-------- day 20 --------
name, sellIn, quality
+5 Dexterity Vest, -10, 0
Aged Brie, -18, 38
Elixir of the Mongoose, -15, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -5, 0
Backstage passes to a TAFKAL80ETC concert, -10, 0
Backstage passes to a TAFKAL80ETC concert, -15, 0
Conjured Mana Cake, -17, 0
-------- day 21 --------
name, sellIn, quality
+5 Dexterity Vest, -11, 0
Aged Brie, -19, 40
Elixir of the Mongoose, -16, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -6, 0
Backstage passes to a TAFKAL80ETC concert, -11, 0
Backstage passes to a TAFKAL80ETC concert, -16, 0
Conjured Mana Cake, -18, 0
-------- day 22 --------
name, sellIn, quality
+5 Dexterity Vest, -12, 0
Aged Brie, -20, 42
Elixir of the Mongoose, -17, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -7, 0
Backstage passes to a TAFKAL80ETC concert, -12, 0
Backstage passes to a TAFKAL80ETC concert, -17, 0
Conjured Mana Cake, -19, 0
-------- day 23 --------
name, sellIn, quality
+5 Dexterity Vest, -13, 0
Aged Brie, -21, 44
Elixir of the Mongoose, -18, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -8, 0
Backstage passes to a TAFKAL80ETC concert, -13, 0
Backstage passes to a TAFKAL80ETC concert, -18, 0
Conjured Mana Cake, -20, 0
-------- day 24 --------
name, sellIn, quality
+5 Dexterity Vest, -14, 0
Aged Brie, -22, 46
Elixir of the Mongoose, -19, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -9, 0
Backstage passes to a TAFKAL80ETC concert, -14, 0
Backstage passes to a TAFKAL80ETC concert, -19, 0
Conjured Mana Cake, -21, 0
-------- day 25 --------
name, sellIn, quality
+5 Dexterity Vest, -15, 0
Aged Brie, -23, 48
Elixir of the Mongoose, -20, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -10, 0
Backstage passes to a TAFKAL80ETC concert, -15, 0
Backstage passes to a TAFKAL80ETC concert, -20, 0
Conjured Mana Cake, -22, 0
-------- day 26 --------
name, sellIn, quality
+5 Dexterity Vest, -16, 0
Aged Brie, -24, 50
Elixir of the Mongoose, -21, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -11, 0
Backstage passes to a TAFKAL80ETC concert, -16, 0
Backstage passes to a TAFKAL80ETC concert, -21, 0
Conjured Mana Cake, -23, 0
-------- day 27 --------
name, sellIn, quality
+5 Dexterity Vest, -17, 0
Aged Brie, -25, 50
Elixir of the Mongoose, -22, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -12, 0
Backstage passes to a TAFKAL80ETC concert, -17, 0
Backstage passes to a TAFKAL80ETC concert, -22, 0
Conjured Mana Cake, -24, 0
-------- day 28 --------
name, sellIn, quality
+5 Dexterity Vest, -18, 0
Aged Brie, -26, 50
Elixir of the Mongoose, -23, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -13, 0
Backstage passes to a TAFKAL80ETC concert, -18, 0
Backstage passes to a TAFKAL80ETC concert, -23, 0
Conjured Mana Cake, -25, 0
-------- day 29 --------
name, sellIn, quality
+5 Dexterity Vest, -19, 0
Aged Brie, -27, 50
Elixir of the Mongoose, -24, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -14, 0
Backstage passes to a TAFKAL80ETC concert, -19, 0
Backstage passes to a TAFKAL80ETC concert, -24, 0
Conjured Mana Cake, -26, 0
-------- day 30 --------
name, sellIn, quality
+5 Dexterity Vest, -20, 0
Aged Brie, -28, 50
Elixir of the Mongoose, -25, 0
Sulfuras, Hand of Ragnaros, 0, 80
Sulfuras, Hand of Ragnaros, -1, 80
Backstage passes to a TAFKAL80ETC concert, -15, 0
Backstage passes to a TAFKAL80ETC concert, -20, 0
Backstage passes to a TAFKAL80ETC concert, -25, 0
Conjured Mana Cake, -27, 0

Some files were not shown because too many files have changed in this diff Show More