From e19161a0cb72ae45a3dedb98bf7f21ad2640d1f4 Mon Sep 17 00:00:00 2001 From: Jacky Shen Date: Mon, 7 Dec 2015 23:23:14 +0800 Subject: [PATCH 01/13] Create GildedRoseRequirements_zh.txt --- GildedRoseRequirements_zh.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 GildedRoseRequirements_zh.txt diff --git a/GildedRoseRequirements_zh.txt b/GildedRoseRequirements_zh.txt new file mode 100644 index 00000000..26b39a51 --- /dev/null +++ b/GildedRoseRequirements_zh.txt @@ -0,0 +1,32 @@ +====================================== +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且永远不变。 From 03a51ec27338e6325cf6c81a7eb0c65a313362a9 Mon Sep 17 00:00:00 2001 From: Emily Bache Date: Fri, 22 Jan 2016 16:55:48 +0100 Subject: [PATCH 02/13] improved installation instructions --- cpp/README | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/cpp/README b/cpp/README index 5d4673a4..bae8ca20 100644 --- a/cpp/README +++ b/cpp/README @@ -1,7 +1,38 @@ +TL;DR; +------- run-once.sh runs your tests once -Assumptions: +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 is in the directory gtest. + - 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". From 0201d9ab7db8c519710094f6cdd3eb57b1bc9c44 Mon Sep 17 00:00:00 2001 From: Pietro Di Bello Date: Sun, 24 Jan 2016 22:58:21 +0100 Subject: [PATCH 03/13] Update URL for a blogpost linked in the README Update URL for the "Writing Good Tests for the Gilded Rose Kata" post --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 423c33da..2621bb30 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ As Bobby Johnson points out in his article ["Why Most Solutions to Gilded Rose M 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://emilybache.blogspot.se/2013/03/writing-good-tests-for-gilded-rose-kata.html) about how you could use this kata in a [coding dojo](https://leanpub.com/codingdojohandbook). +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 From 1599d45f689334d26541e7d4a97998bb80b4ecab Mon Sep 17 00:00:00 2001 From: Pietro Di Bello Date: Mon, 25 Jan 2016 20:42:55 +0100 Subject: [PATCH 04/13] fix typo in requirements --- GildedRoseRequirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GildedRoseRequirements.txt b/GildedRoseRequirements.txt index e2bfd98a..2e74aae6 100644 --- a/GildedRoseRequirements.txt +++ b/GildedRoseRequirements.txt @@ -20,7 +20,7 @@ Pretty simple, right? Well this is where it gets interesting: - "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; + - "Backstage passes", like aged brie, increases in Quality as its 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 @@ -35,4 +35,4 @@ ownership (you can make the UpdateQuality method and Items property static if yo 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. \ No newline at end of file +legendary item and as such its Quality is 80 and it never alters. From 3d8c1f96bcc92a83d8e2998fc538ffec3d5c455f Mon Sep 17 00:00:00 2001 From: Pascal Batty Date: Tue, 26 Jan 2016 15:13:15 +0100 Subject: [PATCH 05/13] Add Swift port --- swift/GildedRose.swift | 61 ++++++++++++++++++++++++++++++++++++++ swift/GildedRoseTest.swift | 13 ++++++++ swift/Item.swift | 18 +++++++++++ swift/main.swift | 30 +++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 swift/GildedRose.swift create mode 100644 swift/GildedRoseTest.swift create mode 100644 swift/Item.swift create mode 100644 swift/main.swift diff --git a/swift/GildedRose.swift b/swift/GildedRose.swift new file mode 100644 index 00000000..649e97e4 --- /dev/null +++ b/swift/GildedRose.swift @@ -0,0 +1,61 @@ + +public class GildedRose { + var items:[Item] + + required public init(items:[Item]) { + self.items = items + } + + public func updateQuality() { + + for i in 0.. 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 + } + } + } + } + } +} diff --git a/swift/GildedRoseTest.swift b/swift/GildedRoseTest.swift new file mode 100644 index 00000000..66b066dd --- /dev/null +++ b/swift/GildedRoseTest.swift @@ -0,0 +1,13 @@ + +import XCTest + +class GildedRoseTest: XCTestCase { + + func testFoo() { + let items = [Item(name: "foo", sellIn: 0, quality: 0)] + let app = GildedRose(items: items); + app.updateQuality(); + XCTAssertEqual("fixme", app.items[0].name); + } + +} diff --git a/swift/Item.swift b/swift/Item.swift new file mode 100644 index 00000000..1533a3da --- /dev/null +++ b/swift/Item.swift @@ -0,0 +1,18 @@ + +public class Item { + public var name: String + public var sellIn: Int + public var quality: Int + + public init(name: String, sellIn: Int, quality: Int) { + self.name = name + self.sellIn = sellIn + self.quality = quality + } +} + +extension Item: CustomStringConvertible { + public var description: String { + return self.name + ", " + String(self.sellIn) + ", " + String(self.quality); + } +} diff --git a/swift/main.swift b/swift/main.swift new file mode 100644 index 00000000..fb95ee9c --- /dev/null +++ b/swift/main.swift @@ -0,0 +1,30 @@ + +let items = [ + Item(name: "+5 Dexterity Vest", sellIn: 10, quality: 20), // + Item(name: "Aged Brie", sellIn: 2, quality: 0), // + Item(name: "Elixir of the Mongoosname: e", sellIn: 5, quality: 7), // + Item(name: "SulfursellIn: as,quality: Hand of Ragnaros", sellIn: 0, quality: 80), // + Item(name: "Sulfuras, Hand of Ragnaros", sellIn: -1, quality: 80), + Item(name: "Backstage passes to a TAFKAL80ETC concert", sellIn: 15, quality: 20), + Item(name: "Backstage passes to a TAFKAL80ETC concert", sellIn: 10, quality: 49), + Item(name: "Backstage passes to a TAFKAL80ETC concert", sellIn: 5, quality: 49), + // this conjured item does not work properly yet + Item(name: "Conjured Mana Cake", sellIn: 3, quality: 6)] + +let app = GildedRose(items: items); + +var days = 2; +if (Process.argc > 1) { + days = Int(Process.arguments[1])! + 1 +} + + +for i in 0.. Date: Mon, 29 Feb 2016 21:30:33 -0500 Subject: [PATCH 06/13] Initial Dart --- dart/.gitignore | 6 + dart/bin/main.dart | 35 ++++++ dart/lib/gilded_rose.dart | 68 +++++++++++ dart/pubspec.lock | 208 ++++++++++++++++++++++++++++++++ dart/pubspec.yaml | 6 + dart/test/gilded_rose_test.dart | 13 ++ 6 files changed, 336 insertions(+) create mode 100644 dart/.gitignore create mode 100644 dart/bin/main.dart create mode 100644 dart/lib/gilded_rose.dart create mode 100644 dart/pubspec.lock create mode 100644 dart/pubspec.yaml create mode 100644 dart/test/gilded_rose_test.dart diff --git a/dart/.gitignore b/dart/.gitignore new file mode 100644 index 00000000..33d0df0e --- /dev/null +++ b/dart/.gitignore @@ -0,0 +1,6 @@ +# Files and directories created by pub +.packages +.pub/ +packages +pubspec.lock # (Remove this pattern if you wish to check in your lock file) +.idea \ No newline at end of file diff --git a/dart/bin/main.dart b/dart/bin/main.dart new file mode 100644 index 00000000..240994c5 --- /dev/null +++ b/dart/bin/main.dart @@ -0,0 +1,35 @@ +import 'package:gilded_rose/gilded_rose.dart'; + +main(List args) { + print("OMGHAI!"); + + var 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) + ]; + + GildedRose app = new GildedRose(items); + + int days = 2; + if (args.length > 0) { + days = int.parse(args[0]) + 1; + } + + for (int i = 0; i < days; i++) { + print("-------- day $i --------"); + print("name, sellIn, quality"); + for (var item in items) { + print(item); + } + print(''); + app.updateQuality(); + } +} diff --git a/dart/lib/gilded_rose.dart b/dart/lib/gilded_rose.dart new file mode 100644 index 00000000..94857b32 --- /dev/null +++ b/dart/lib/gilded_rose.dart @@ -0,0 +1,68 @@ +class GildedRose { + List items; + + GildedRose(this.items); + + void updateQuality() { + for (int i = 0; i < items.length; 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; + } + } + } + } + } +} + +class Item { + String name; + int sellIn; + int quality; + + Item(this.name, this.sellIn, this.quality); + + String toString() => '$name, $sellIn, $quality'; +} diff --git a/dart/pubspec.lock b/dart/pubspec.lock new file mode 100644 index 00000000..dcf8bbd3 --- /dev/null +++ b/dart/pubspec.lock @@ -0,0 +1,208 @@ +# Generated by pub +# See http://pub.dartlang.org/doc/glossary.html#lockfile +packages: + analyzer: + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.2" + args: + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.3+4" + async: + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + barback: + description: + name: barback + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.2+7" + boolean_selector: + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + charcode: + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + crypto: + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.1" + csslib: + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + glob: + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + html: + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2+1" + http_multi_server: + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + http_parser: + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + logging: + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.2" + matcher: + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+1" + mime: + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.3" + package_config: + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + path: + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.9" + plugin: + description: + name: plugin + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" + pool: + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + pub_semver: + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.3" + shelf: + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.5" + shelf_static: + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.3+3" + shelf_web_socket: + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" + source_map_stack_trace: + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + source_maps: + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.1" + source_span: + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + stack_trace: + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.1" + stream_channel: + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + string_scanner: + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+1" + test: + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + utf: + description: + name: utf + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+3" + watcher: + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" + yaml: + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.8" +sdk: ">=1.14.0 <1.16.0" diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml new file mode 100644 index 00000000..06814a33 --- /dev/null +++ b/dart/pubspec.yaml @@ -0,0 +1,6 @@ +name: gilded_rose +version: 0.0.1 +description: A simple console application. + +dev_dependencies: + test: '>=0.12.11 <0.13.0' diff --git a/dart/test/gilded_rose_test.dart b/dart/test/gilded_rose_test.dart new file mode 100644 index 00000000..69e4a489 --- /dev/null +++ b/dart/test/gilded_rose_test.dart @@ -0,0 +1,13 @@ +import 'package:test/test.dart'; +import 'package:gilded_rose/gilded_rose.dart'; + +main() { + test('foo', () { + var item = new Item('foo', 0, 0); + var items = [item]; + + GildedRose app = new GildedRose(items); + app.updateQuality(); + expect("fixme", app.items[0].name); + }); +} From 028e85b433feb65674eb224e841d8af9921b8038 Mon Sep 17 00:00:00 2001 From: Joel Trottier-Hebert Date: Fri, 18 Mar 2016 22:39:31 -0400 Subject: [PATCH 07/13] removed pubspec.lock --- dart/pubspec.lock | 208 ---------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 dart/pubspec.lock diff --git a/dart/pubspec.lock b/dart/pubspec.lock deleted file mode 100644 index dcf8bbd3..00000000 --- a/dart/pubspec.lock +++ /dev/null @@ -1,208 +0,0 @@ -# Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile -packages: - analyzer: - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.27.2" - args: - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3+4" - async: - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - barback: - description: - name: barback - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.2+7" - boolean_selector: - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - charcode: - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - crypto: - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.1" - csslib: - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - glob: - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - html: - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2+1" - http_multi_server: - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - http_parser: - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - logging: - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.2" - matcher: - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.0+1" - mime: - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.3" - package_config: - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - path: - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.9" - plugin: - description: - name: plugin - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - pool: - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - pub_semver: - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.3" - shelf: - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.5" - shelf_static: - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.3+3" - shelf_web_socket: - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - source_map_stack_trace: - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - source_maps: - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.1" - source_span: - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - stack_trace: - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.1" - stream_channel: - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - string_scanner: - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+1" - test: - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - utf: - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+3" - watcher: - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - yaml: - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.8" -sdk: ">=1.14.0 <1.16.0" From f00e363caafb740727b4cfe375990a20e0dcac1b Mon Sep 17 00:00:00 2001 From: Georg Berky Date: Sat, 14 May 2016 17:31:39 +0200 Subject: [PATCH 08/13] Add Groovy sources and IntelliJ project --- .idea/modules.xml | 3 +- Groovy/.gitignore | 124 ++++++++++++++++++ Groovy/.idea/compiler.xml | 22 ++++ Groovy/.idea/copyright/profiles_settings.xml | 3 + Groovy/.idea/misc.xml | 26 ++++ Groovy/.idea/modules.xml | 8 ++ Groovy/Groovy.iml | 12 ++ Groovy/readme.txt | 8 ++ Groovy/src/com/gildedrose/GildedRose.groovy | 62 +++++++++ .../src/com/gildedrose/GildedRoseTest.groovy | 15 +++ Groovy/src/com/gildedrose/Item.groovy | 21 +++ .../src/com/gildedrose/TexttestFixture.groovy | 32 +++++ 12 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 Groovy/.gitignore create mode 100644 Groovy/.idea/compiler.xml create mode 100644 Groovy/.idea/copyright/profiles_settings.xml create mode 100644 Groovy/.idea/misc.xml create mode 100644 Groovy/.idea/modules.xml create mode 100644 Groovy/Groovy.iml create mode 100644 Groovy/readme.txt create mode 100644 Groovy/src/com/gildedrose/GildedRose.groovy create mode 100644 Groovy/src/com/gildedrose/GildedRoseTest.groovy create mode 100644 Groovy/src/com/gildedrose/Item.groovy create mode 100644 Groovy/src/com/gildedrose/TexttestFixture.groovy diff --git a/.idea/modules.xml b/.idea/modules.xml index 4278bcdd..75acca37 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -5,5 +5,4 @@ - - + \ No newline at end of file diff --git a/Groovy/.gitignore b/Groovy/.gitignore new file mode 100644 index 00000000..8f0aaba4 --- /dev/null +++ b/Groovy/.gitignore @@ -0,0 +1,124 @@ + +# 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 + diff --git a/Groovy/.idea/compiler.xml b/Groovy/.idea/compiler.xml new file mode 100644 index 00000000..96cc43ef --- /dev/null +++ b/Groovy/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Groovy/.idea/copyright/profiles_settings.xml b/Groovy/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/Groovy/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Groovy/.idea/misc.xml b/Groovy/.idea/misc.xml new file mode 100644 index 00000000..c6d8fb73 --- /dev/null +++ b/Groovy/.idea/misc.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Groovy/.idea/modules.xml b/Groovy/.idea/modules.xml new file mode 100644 index 00000000..c1a39855 --- /dev/null +++ b/Groovy/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Groovy/Groovy.iml b/Groovy/Groovy.iml new file mode 100644 index 00000000..85bea791 --- /dev/null +++ b/Groovy/Groovy.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Groovy/readme.txt b/Groovy/readme.txt new file mode 100644 index 00000000..1f869aac --- /dev/null +++ b/Groovy/readme.txt @@ -0,0 +1,8 @@ +Welcome to the Groovy Gilded Rose +================================= + +to run the tests, you can either: +- run them from your favorite IDE +- run them from the src/ folder in your shell: + - $ groovy com/gildedrose/GildedRoseTest.groovy + diff --git a/Groovy/src/com/gildedrose/GildedRose.groovy b/Groovy/src/com/gildedrose/GildedRose.groovy new file mode 100644 index 00000000..ba054cb6 --- /dev/null +++ b/Groovy/src/com/gildedrose/GildedRose.groovy @@ -0,0 +1,62 @@ +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 + } + } + } + } + } +} diff --git a/Groovy/src/com/gildedrose/GildedRoseTest.groovy b/Groovy/src/com/gildedrose/GildedRoseTest.groovy new file mode 100644 index 00000000..d96202c0 --- /dev/null +++ b/Groovy/src/com/gildedrose/GildedRoseTest.groovy @@ -0,0 +1,15 @@ +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 + } + +} diff --git a/Groovy/src/com/gildedrose/Item.groovy b/Groovy/src/com/gildedrose/Item.groovy new file mode 100644 index 00000000..c42d6cea --- /dev/null +++ b/Groovy/src/com/gildedrose/Item.groovy @@ -0,0 +1,21 @@ +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 + } +} diff --git a/Groovy/src/com/gildedrose/TexttestFixture.groovy b/Groovy/src/com/gildedrose/TexttestFixture.groovy new file mode 100644 index 00000000..3c8b46e3 --- /dev/null +++ b/Groovy/src/com/gildedrose/TexttestFixture.groovy @@ -0,0 +1,32 @@ +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() +} From 8f18f8a1f9a07ac7799ff393716ce00a27f8910a Mon Sep 17 00:00:00 2001 From: Georg Berky Date: Sat, 14 May 2016 17:55:42 +0200 Subject: [PATCH 09/13] improve instructions for IDEs --- Groovy/readme.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Groovy/readme.txt b/Groovy/readme.txt index 1f869aac..664827d7 100644 --- a/Groovy/readme.txt +++ b/Groovy/readme.txt @@ -1,8 +1,17 @@ Welcome to the Groovy Gilded Rose ================================= -to run the tests, you can either: +to run the test, you can either: - run them from your favorite IDE -- run them from the src/ folder in your shell: + - 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 From 7bf5e95b5b59c8e5f1735f9451b39b3f08da3b4e Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 23 May 2016 10:52:28 +0200 Subject: [PATCH 10/13] Fix link to blog post see issue #32 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2621bb30..6c77f88e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This Kata was originally created by Terry Hughes (http://twitter.com/#!/TerryHug 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 +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. From e8446e057ee8c483833d0d6e5a05d1f1da1a3d39 Mon Sep 17 00:00:00 2001 From: Georg Berky Date: Thu, 2 Jun 2016 21:21:32 +0200 Subject: [PATCH 11/13] Common Lisp version by Rainer Joswig --- clisp/gilded-rose.lisp | 140 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 clisp/gilded-rose.lisp diff --git a/clisp/gilded-rose.lisp b/clisp/gilded-rose.lisp new file mode 100644 index 00000000..59143a42 --- /dev/null +++ b/clisp/gilded-rose.lisp @@ -0,0 +1,140 @@ +; 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 From ebf7487c70622ea4a248f86482274b0a764ad66a Mon Sep 17 00:00:00 2001 From: emilybache Date: Wed, 8 Jun 2016 07:59:52 +0200 Subject: [PATCH 12/13] added C++ cyber-dojo link --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6c77f88e..c31395e9 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ I've also set this kata up on [cyber-dojo](http://cyber-dojo.org) for several la - [JUnit, Java](http://cyber-dojo.org/forker/fork/751DD02C4C?avatar=snake&tag=4) - [C#](http://cyber-dojo.org/forker/fork/5C5AC766B0?avatar=koala&tag=1) +- [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) From 7cd39905b104a12d389d0202f2fc7ff90089c2b4 Mon Sep 17 00:00:00 2001 From: Sherbakov Oleg Date: Sat, 11 Jun 2016 23:53:18 +0400 Subject: [PATCH 13/13] Added requirements specification in russian language. --- GildedRoseRequirements_ru.txt | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 GildedRoseRequirements_ru.txt diff --git a/GildedRoseRequirements_ru.txt b/GildedRoseRequirements_ru.txt new file mode 100644 index 00000000..cdb1355b --- /dev/null +++ b/GildedRoseRequirements_ru.txt @@ -0,0 +1,43 @@ +====================================== +Технические требования «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 и оно никогда не меняется.