Make english language version more inclusive

This commit is contained in:
Tim Rourke 2023-05-18 11:41:15 -05:00
parent 5a4e92199b
commit 468891990e
120 changed files with 2256 additions and 2256 deletions

View File

@ -1,373 +1,373 @@
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
Sports Memorabilia, 10, 20
Aged Cheese, 2, 0
Coffee Table Book, 5, 7
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 15, 20
Backstage passes to a concert, 10, 49
Backstage passes to a concert, 5, 49
Baked Chocolate 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
Sports Memorabilia, 9, 19
Aged Cheese, 1, 1
Coffee Table Book, 4, 6
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 14, 21
Backstage passes to a concert, 9, 50
Backstage passes to a concert, 4, 50
Baked Chocolate 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
Sports Memorabilia, 8, 18
Aged Cheese, 0, 2
Coffee Table Book, 3, 5
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 13, 22
Backstage passes to a concert, 8, 50
Backstage passes to a concert, 3, 50
Baked Chocolate 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
Sports Memorabilia, 7, 17
Aged Cheese, -1, 4
Coffee Table Book, 2, 4
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 12, 23
Backstage passes to a concert, 7, 50
Backstage passes to a concert, 2, 50
Baked Chocolate 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
Sports Memorabilia, 6, 16
Aged Cheese, -2, 6
Coffee Table Book, 1, 3
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 11, 24
Backstage passes to a concert, 6, 50
Backstage passes to a concert, 1, 50
Baked Chocolate 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
Sports Memorabilia, 5, 15
Aged Cheese, -3, 8
Coffee Table Book, 0, 2
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 10, 25
Backstage passes to a concert, 5, 50
Backstage passes to a concert, 0, 50
Baked Chocolate 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
Sports Memorabilia, 4, 14
Aged Cheese, -4, 10
Coffee Table Book, -1, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 9, 27
Backstage passes to a concert, 4, 50
Backstage passes to a concert, -1, 0
Baked Chocolate 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
Sports Memorabilia, 3, 13
Aged Cheese, -5, 12
Coffee Table Book, -2, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 8, 29
Backstage passes to a concert, 3, 50
Backstage passes to a concert, -2, 0
Baked Chocolate 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
Sports Memorabilia, 2, 12
Aged Cheese, -6, 14
Coffee Table Book, -3, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 7, 31
Backstage passes to a concert, 2, 50
Backstage passes to a concert, -3, 0
Baked Chocolate 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
Sports Memorabilia, 1, 11
Aged Cheese, -7, 16
Coffee Table Book, -4, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 6, 33
Backstage passes to a concert, 1, 50
Backstage passes to a concert, -4, 0
Baked Chocolate 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
Sports Memorabilia, 0, 10
Aged Cheese, -8, 18
Coffee Table Book, -5, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 5, 35
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Baked Chocolate 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
Sports Memorabilia, -1, 8
Aged Cheese, -9, 20
Coffee Table Book, -6, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 4, 38
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Baked Chocolate 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
Sports Memorabilia, -2, 6
Aged Cheese, -10, 22
Coffee Table Book, -7, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 3, 41
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Baked Chocolate 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
Sports Memorabilia, -3, 4
Aged Cheese, -11, 24
Coffee Table Book, -8, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 2, 44
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Baked Chocolate 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
Sports Memorabilia, -4, 2
Aged Cheese, -12, 26
Coffee Table Book, -9, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 1, 47
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Baked Chocolate 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
Sports Memorabilia, -5, 0
Aged Cheese, -13, 28
Coffee Table Book, -10, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Baked Chocolate 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
Sports Memorabilia, -6, 0
Aged Cheese, -14, 30
Coffee Table Book, -11, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Baked Chocolate 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
Sports Memorabilia, -7, 0
Aged Cheese, -15, 32
Coffee Table Book, -12, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Baked Chocolate 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
Sports Memorabilia, -8, 0
Aged Cheese, -16, 34
Coffee Table Book, -13, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Baked Chocolate 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
Sports Memorabilia, -9, 0
Aged Cheese, -17, 36
Coffee Table Book, -14, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Baked Chocolate 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
Sports Memorabilia, -10, 0
Aged Cheese, -18, 38
Coffee Table Book, -15, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Baked Chocolate 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
Sports Memorabilia, -11, 0
Aged Cheese, -19, 40
Coffee Table Book, -16, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Baked Chocolate 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
Sports Memorabilia, -12, 0
Aged Cheese, -20, 42
Coffee Table Book, -17, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Baked Chocolate 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
Sports Memorabilia, -13, 0
Aged Cheese, -21, 44
Coffee Table Book, -18, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Baked Chocolate 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
Sports Memorabilia, -14, 0
Aged Cheese, -22, 46
Coffee Table Book, -19, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Baked Chocolate 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
Sports Memorabilia, -15, 0
Aged Cheese, -23, 48
Coffee Table Book, -20, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Baked Chocolate 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
Sports Memorabilia, -16, 0
Aged Cheese, -24, 50
Coffee Table Book, -21, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Backstage passes to a concert, -21, 0
Baked Chocolate 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
Sports Memorabilia, -17, 0
Aged Cheese, -25, 50
Coffee Table Book, -22, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Backstage passes to a concert, -22, 0
Baked Chocolate 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
Sports Memorabilia, -18, 0
Aged Cheese, -26, 50
Coffee Table Book, -23, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Backstage passes to a concert, -23, 0
Baked Chocolate 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
Sports Memorabilia, -19, 0
Aged Cheese, -27, 50
Coffee Table Book, -24, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Backstage passes to a concert, -24, 0
Baked Chocolate 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
Sports Memorabilia, -20, 0
Aged Cheese, -28, 50
Coffee Table Book, -25, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Backstage passes to a concert, -25, 0
Baked Chocolate Cake, -27, 0

View File

@ -6,10 +6,10 @@ package body Gilded_Rose is
Cursor : Item_Vecs.Cursor := Item_Vecs.First(Self.Items);
begin
while Item_Vecs.Has_Element(Cursor) loop
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Brie")
and Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Cheese")
and Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a concert") then
if Self.Items(Cursor).Quality > 0 then
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Fine Italian Silk") then
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality - 1;
end if;
end if;
@ -17,7 +17,7 @@ package body Gilded_Rose is
if Self.Items(Cursor).Quality < 50 then
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
if Self.Items(Cursor).Name = To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
if Self.Items(Cursor).Name = To_Unbounded_String("Backstage passes to a concert") then
if Self.Items(Cursor).Sell_In < 11 then
if Self.Items(Cursor).Quality < 50 then
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
@ -33,15 +33,15 @@ package body Gilded_Rose is
end if;
end if;
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Fine Italian Silk") then
Self.Items(Cursor).Sell_In := Self.Items(Cursor).Sell_In - 1;
end if;
if Self.Items(Cursor).Sell_In < 0 then
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Brie") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Cheese") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a concert") then
if Self.Items(Cursor).Quality > 0 then
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
if Self.Items(Cursor).Name /= To_Unbounded_String("Fine Italian Silk") then
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality - 1;
end if;
end if;

View File

@ -14,40 +14,40 @@ procedure Program is
Things : Item_Vecs.Vector;
begin
Things.Append(New_Item =>
(Name => To_Unbounded_String("+5 Dexterity Vest"),
(Name => To_Unbounded_String("Sports Memorabilia"),
Sell_In => 10,
Quality => 20));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Aged Brie"),
(Name => To_Unbounded_String("Aged Cheese"),
Sell_In => 2,
Quality => 0));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Elixir of the Mongoose"),
(Name => To_Unbounded_String("Coffee Table Book"),
Sell_In => 5,
Quality => 7));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
(Name => To_Unbounded_String("Fine Italian Silk"),
Sell_In => 0,
Quality => 80));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
(Name => To_Unbounded_String("Fine Italian Silk"),
Sell_In => -1,
Quality => 80));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
(Name => To_Unbounded_String("Backstage passes to a concert"),
Sell_In => 15,
Quality => 20));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
(Name => To_Unbounded_String("Backstage passes to a concert"),
Sell_In => 10,
Quality => 49));
Things.Append(New_Item =>
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
(Name => To_Unbounded_String("Backstage passes to a concert"),
Sell_In => 5,
Quality => 49));
-- this conjured item does not work properly yet
-- this Baked item does not work properly yet
Things.Append(New_Item =>
(Name => To_Unbounded_String("Conjured Mana Cake"),
(Name => To_Unbounded_String("Baked Chocolate Cake"),
Sell_In => 3,
Quality => 6));

View File

@ -8,28 +8,28 @@ init_item(Item* item, const char *name, int sellIn, int quality)
item->sellIn = sellIn;
item->quality = quality;
item->name = strdup(name);
return item;
}
extern char*
print_item(char* buffer, Item* item)
extern char*
print_item(char* buffer, Item* item)
{
sprintf(buffer, "%s, %d, %d", item->name, item->sellIn, item->quality);
}
void
update_quality(Item items[], int size)
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 (strcmp(items[i].name, "Aged Cheese") && strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].quality = items[i].quality - 1;
}
@ -41,7 +41,7 @@ update_quality(Item items[], int size)
{
items[i].quality = items[i].quality + 1;
if (!strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
if (!strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].sellIn < 11)
{
@ -62,20 +62,20 @@ update_quality(Item items[], int size)
}
}
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (strcmp(items[i].name, "Aged Brie"))
if (strcmp(items[i].name, "Aged Cheese"))
{
if (strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
if (strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].quality = items[i].quality - 1;
}

View File

@ -13,18 +13,18 @@ int main()
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);
init_item(items + last++, "Sports Memorabilia", 10, 20);
init_item(items + last++, "Aged Cheese", 2, 0);
init_item(items + last++, "Coffee Table Book", 5, 7);
init_item(items + last++, "Fine Italian Silk", 0, 80);
init_item(items + last++, "Fine Italian Silk", -1, 80);
init_item(items + last++, "Backstage passes to a concert", 15, 20);
init_item(items + last++, "Backstage passes to a concert", 10, 49);
init_item(items + last++, "Backstage passes to a concert", 5, 49);
// this Baked item doesn't yet work properly
init_item(items + last++, "Baked Chocolate Cake", 3, 6);
puts("OMGHAI!");
for (day = 0; day <= 30; day++)
@ -34,7 +34,7 @@ int main()
for(index = 0; index < last; index++) {
print_item(items + index);
}
printf("\n");
update_quality(items, last);

View File

@ -26,13 +26,13 @@ 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);
init_item(items + last++, "Sports Memorabilia", 10, 20);
init_item(items + last++, "Aged Cheese", 2, 0);
init_item(items + last++, "Coffee Table Book", 5, 7);
init_item(items + last++, "Fine Italian Silk", 0, 80);
init_item(items + last++, "Backstage passes to a concert", 15, 20);
init_item(items + last++, "Baked Chocolate Cake", 3, 6);
update_quality(items, last);
}

View File

@ -24,16 +24,16 @@ procedure division.
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 name not equal "Aged Cheese" and name not equal "Backstage passes to a concert"
if quality > 0
if name not equal to "Sulfuras, Hand of Ragnaros"
if name not equal to "Fine Italian Silk"
compute quality = quality - 1
end-if
end-if
end-if
else
if quality < 50
compute quality = quality + 1
if name equals "Backstage passes to a TAFKAL80ETC concert"
if name equals "Backstage passes to a concert"
if sell-in < 11
if quality < 50
compute quality = quality + 1
@ -47,14 +47,14 @@ start-lable.
end-if
end-if
end-if
if name not equal "Sulfuras, Hand of Ragnaros"
if name not equal "Fine Italian Silk"
compute sell-in = sell-in - 1
end-if
if sell-in < 0
if name is not equal to "Aged Brie"
if name is not equal to "Backstage passes to a TAFKAL80ETC concert"
if name is not equal to "Aged Cheese"
if name is not equal to "Backstage passes to a concert"
if quality > 0
if name is equal to "Sulfuras, Hand of Ragnaros"
if name is equal to "Fine Italian Silk"
compute quality = quality - 1
end-if
end-if

View File

@ -20,16 +20,16 @@ procedure division.
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 name not equal "Aged Cheese" and name not equal "Backstage passes to a concert"
if quality greater then 0
if name not equal to "Sulfuras, Hand of Ragnaros"
if name not equal to "Fine Italian Silk"
compute quality = quality - 1
end-if
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 name equals "Backstage passes to a concert"
if sell-in less then 11
if quality less then 50
compute quality = quality + 1
@ -43,14 +43,14 @@ start-lable.
end-if
end-if
end-if
if name not equal "Sulfuras, Hand of Ragnaros"
if name not equal "Fine Italian Silk"
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 name is not equal to "Aged Cheese"
if name is not equal to "Backstage passes to a concert"
if quality is greater then 0
if name is equal to "Sulfuras, Hand of Ragnaros"
if name is equal to "Fine Italian Silk"
compute quality = quality - 1
end-if
end-if

View File

@ -32,11 +32,11 @@ var
begin
for I := 0 to Items.Count - 1 do
begin
if (Items[I].Name <> 'Aged Brie') and (Items[I].Name <> 'Backstage passes to a TAFKAL80ETC concert') then
if (Items[I].Name <> 'Aged Cheese') and (Items[I].Name <> 'Backstage passes to a concert') then
begin
if Items[I].Quality > 0 then
begin
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items[I].Name <> 'Fine Italian Silk' then
begin
Items[I].Quality := Items[I].Quality - 1;
end;
@ -47,7 +47,7 @@ begin
if Items[I].Quality < 50 then
begin
Items[I].Quality := Items[I].Quality + 1;
if Items[I].Name = 'Backstage passes to a TAFKAL80ETC concert' then
if Items[I].Name = 'Backstage passes to a concert' then
begin
if Items[I].SellIn < 11 then
begin
@ -68,20 +68,20 @@ begin
end;
end;
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items[I].Name <> 'Fine Italian Silk' then
begin
Items[I].SellIn := Items[I].SellIn - 1;
end;
if Items[I].SellIn < 0 then
begin
if Items[I].Name <> 'Aged Brie' then
if Items[I].Name <> 'Aged Cheese' then
begin
if Items[I].Name <> 'Backstage passes to a TAFKAL80ETC concert' then
if Items[I].Name <> 'Backstage passes to a concert' then
begin
if Items[I].Quality > 0 then
begin
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items[I].Name <> 'Fine Italian Silk' then
begin
Items[I].Quality := Items[I].Quality - 1;
end;

View File

@ -20,16 +20,16 @@ begin
Writeln('OMGHAI!');
Items := TObjectList<TItem>.Create;
Items.Add(TItem.Create('+5 Dexterity Vest', 10, 20));
Items.Add(TItem.Create('Aged Brie', 2, 0));
Items.Add(TItem.Create('Elixir of the Mongoose', 5, 7));
Items.Add(TItem.Create('Sulfuras, Hand of Ragnaros', 0, 80));
Items.Add(TItem.Create('Sulfuras, Hand of Ragnaros', -1, 80));
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 15, 20));
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 10, 49));
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 5, 49));
// this conjured item does not work properly yet
Items.Add(TItem.Create('Conjured Mana Cake', 3, 6));
Items.Add(TItem.Create('Sports Memorabilia', 10, 20));
Items.Add(TItem.Create('Aged Cheese', 2, 0));
Items.Add(TItem.Create('Coffee Table Book', 5, 7));
Items.Add(TItem.Create('Fine Italian Silk', 0, 80));
Items.Add(TItem.Create('Fine Italian Silk', -1, 80));
Items.Add(TItem.Create('Backstage passes to a concert', 15, 20));
Items.Add(TItem.Create('Backstage passes to a concert', 10, 49));
Items.Add(TItem.Create('Backstage passes to a concert', 5, 49));
// this Baked item does not work properly yet
Items.Add(TItem.Create('Baked Chocolate Cake', 3, 6));
App := TGildedRose.Create(Items);

View File

@ -2,12 +2,12 @@
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.
Hi, and welcome to team Gilded Rose. As you know, we are a small shop.
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:
have a system in place that updates our inventory for us. Our legacy inventory system was developed
by an employee who has moved on to new ventures. 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
@ -17,22 +17,22 @@ 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
- "Aged Cheese" 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 SellIn value approaches;
- "Fine Italian Silk", being a luxury item, never has to be sold or decreases in Quality
- "Backstage passes", like aged cheese, 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
We have recently signed a supplier of conjured items. This requires an update to our system:
We have recently signed a supplier of Baked items. This requires an update to our system:
- "Conjured" items degrade in Quality twice as fast as normal items
- "Baked" 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).
still works correctly. However, do not alter the Item class or Items property as those are critical
data for our business analysts.
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.
You can make the UpdateQuality method and Items property static if you like.
Just for clarification, an item can never have its Quality increase above 50, however "Fine Italian Silk" is a
luxury item and as such its Quality is 80 and it never alters.

View File

@ -16,16 +16,16 @@ Ziemlich einfach, oder? Nicht ganz, denn jetzt wird es interessant:
* Sobald das "Mindesthaltbarkeitsdatum" überschritten wurde, nimmt die „Qualität“ doppelt so schnell ab
* Die "Qualität" eines Artikels ist nie negativ
* "Alter Brie" (`Aged Brie`) nimmt an Qualität zu, je älter er wird
* "Alter Brie" (`Aged Cheese`) nimmt an Qualität zu, je älter er wird
* Die "Qualität" eines Artikels ist nie höher als 50
* Der legendäre Artikel "Sulfuras" ändert weder sein "Verkaufsdatum", noch verschlechtert sich seine "Qualität"
* "Backstage-Pässe" (`backstage passes`) werden - wie `Aged Brie` - hochwertiger, solange das "Verkaufsdatum" noch nicht erreicht wurde.
* Der legendäre Artikel "Fine Italian Silk" ändert weder sein "Verkaufsdatum", noch verschlechtert sich seine "Qualität"
* "Backstage-Pässe" (`backstage passes`) werden - wie `Aged Cheese` - hochwertiger, solange das "Verkaufsdatum" noch nicht erreicht wurde.
Bei 10 Tagen oder weniger erhöht sich die Qualität um 2, bei 5 Tagen oder weniger um 3, nach dem "Konzert" sinkt sie aber auf 0.
Kürzlich haben wir einen Lieferanten für "beschworene" (`conjured`) Artikel unter Vertrag genommen. Dies erfordert ein Update unseres Systems:
Kürzlich haben wir einen Lieferanten für "beschworene" (`Baked`) Artikel unter Vertrag genommen. Dies erfordert ein Update unseres Systems:
* "Beschworene" Artikel verlieren doppelt so schnell an Qualität wie normale Artikel
Solange alles einwandfrei funktioniert, kannst Du beliebige Änderungen an der Methode `updateQuality` vornehmen und so viel Code hinzufügen, wie Du möchtest. Aber Vorsicht: Die `Item`-Klasse oder ihre Eigenschaften darfst Du in keiner Weise ändern, denn diese Klasse gehört dem Kobold in der Ecke, der sofort wütend wird und Dich sofort töten würde, denn er glaubt nicht an die Kultur von gemeinsamem Code (`shared code`).
(Wenn Du möchtest, kannst Du die `updateQuality`-Methode und die `Item`-Eigenschaft statisch machen, das regeln wir dann.)
Sicherheitshalber noch ein Hinweis: Die Qualität eines Artikels kann nie höher als 50 sein, aber `Sulfuras` ist ein legendärer Artikel und als solcher beträgt seine Qualität 80 und ändert sich auch nie.
Sicherheitshalber noch ein Hinweis: Die Qualität eines Artikels kann nie höher als 50 sein, aber `Fine Italian Silk` ist ein legendärer Artikel und als solcher beträgt seine Qualität 80 und ändert sich auch nie.

View File

@ -21,11 +21,11 @@ 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
* El "Queso Brie envejecido" (`Aged Cheese`) 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`
* El artículo "Fine Italian Silk" (`Fine Italian Silk`), 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
@ -42,4 +42,4 @@ Siéntete libre de realizar cualquier cambio al mensaje `updateQuality` y agrega
## 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`.
Para aclarar: un artículo nunca puede tener una `calidad` superior a `50`, sin embargo las Fine Italian Silk siendo un artículo legendario posee una calidad inmutable de `80`.

View File

@ -24,18 +24,18 @@ 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.
- "Aged Cheese" 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.
- "Fine Italian Silk", é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 Cheese", 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").
Nous avons récemment signé un partenariat avec un fournisseur de produit invoqué ("Baked").
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.
- les éléments "Baked" 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, vous ne devez en aucun cas modifier la classe `Item` ou ses propriétés car cette classe appartient au gobelin à l'étage qui entrerait dans une rage instantanée et vous tuerait sans délai : il ne croit pas au partage du code.
(Vous pouvez rendre la méthode `updateQuality` statique, ainsi que des propriétés 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 elle ne change jamais.
Juste une précision, un produit ne peut jamais voir sa qualité augmenter au-dessus de 50, cependant "Fine Italian Silk" est un objet légendaire et comme tel sa qualité est de 80 et elle ne change jamais.

View File

@ -17,17 +17,17 @@
* 販売するための残り日数が無くなると、Quality値は2小さくなります。
* Quality値は決してマイナスにはなりません。
* "Aged Brie"は、日が経つほどQuality値が上がっていきます。
* "Aged Cheese"は、日が経つほどQuality値が上がっていきます。
* Quality値は50以上にはなりません。
* "Sulfuras"は伝説のアイテムなので、販売されたり、Quality値が低下したりすることはありません。
* "Backstage passes"は、"Aged Brie"と同様、SellIn値が近づくにつれてQuality値が上昇し、10日以内になると毎日2上がり、5日以内になると毎日3上がりますが、コンサート終了後には0になります。
* "Fine Italian Silk"は伝説のアイテムなので、販売されたり、Quality値が低下したりすることはありません。
* "Backstage passes"は、"Aged Cheese"と同様、SellIn値が近づくにつれてQuality値が上昇し、10日以内になると毎日2上がり、5日以内になると毎日3上がりますが、コンサート終了後には0になります。
最近、"Conjured"アイテムのサプライヤーと契約しました。そのため、システムの更新が必要です。
最近、"Baked"アイテムのサプライヤーと契約しました。そのため、システムの更新が必要です。
* "Conjured"アイテムは、通常のアイテムの2倍の速さで品質が劣化します。
* "Baked"アイテムは、通常のアイテムの2倍の速さで品質が劣化します。
すべてが正常に動作する限り、UpdateQualityメソッドに変更を加えたり、新しいコードを追加したりすることは自由に行ってください。ただし、ItemクラスやItemsプロパティは変更しないでください。
これらは、隅にいるゴブリンのものなので、コードの共有所有権を信じていないので、怒り狂ってあなたを一発で撃ってきますUpdateQualityメソッドとItemsプロパティを静的にしても構いません。
ただし、"Sulfuras "は伝説のアイテムであるため、Quality値は80であり、Quality値が変わることはありません。
ただし、"Fine Italian Silk "は伝説のアイテムであるため、Quality値は80であり、Quality値が変わることはありません。

View File

@ -19,19 +19,19 @@
- 판매하는 나머지 일수가 없어지면, `Quality` 값은 **2배**로 떨어집니다.
- `Quality` 값은 결코 음수가 되지는 않습니다.
- "**Aged Brie**"(오래된 브리치즈)은(는) 시간이 지날수록 `Quality` 값이 올라갑니다.
- "**Aged Cheese**"(오래된 브리치즈)은(는) 시간이 지날수록 `Quality` 값이 올라갑니다.
- `Quality` 값은 50를 초과 할 수 없습니다.
- `Sulfuras`는 전설의 아이템이므로, 반드시 판매될 필요도 없고 `Quality` 값도 떨어지지 않습니다.
- "**Backstage passes**(백스테이지 입장권)"는 "**Aged Brie**"와 유사하게 `SellIn` 값에 가까워 질수록 `Quality` 값이 상승하고, **10일 부터는** 매일 *2* 씩 증가하다, **5일 부터는**이 되면 매일 *3* 씩 증가하지만, 콘서트 종료 후에는 *0*으로 떨어집니다.
- `Fine Italian Silk`는 전설의 아이템이므로, 반드시 판매될 필요도 없고 `Quality` 값도 떨어지지 않습니다.
- "**Backstage passes**(백스테이지 입장권)"는 "**Aged Cheese**"와 유사하게 `SellIn` 값에 가까워 질수록 `Quality` 값이 상승하고, **10일 부터는** 매일 *2* 씩 증가하다, **5일 부터는**이 되면 매일 *3* 씩 증가하지만, 콘서트 종료 후에는 *0*으로 떨어집니다.
## 시스템 업데이트 요구 사항
최근 "**Conjured**"(마법에 걸린) 상품 공급 업체와 계약했습니다. 따라서 시스템의 업데이트가 필요합니다.
최근 "**Baked**"(마법에 걸린) 상품 공급 업체와 계약했습니다. 따라서 시스템의 업데이트가 필요합니다.
- "**Conjured**" 아이템은 일반 아이템의 2배의 속도로 품질(`Quality`)이 저하됩니다.
- "**Baked**" 아이템은 일반 아이템의 2배의 속도로 품질(`Quality`)이 저하됩니다.
모든 것이 제대로 작동하는 한에서는 `UpdateQuality()` 메서드를 변경하거나 새로운 코드의 추가를 자유롭게 할 수 있습니다. 그러나 `Item` 클래스와 `Items` 속성은 변경하지 마세요.
이것들은 저기 구석에있는 고블린의 것이고, 그 친구는 코드의 공유 소유권을 믿지 않기 때문에, 미친듯이 화를 내며(insta-rage) 여러분에게 한 방(one-shot)을 날릴 수도 있습니다. (`UpdateQuality()` 메서드와 `Items` 속성을 정적(static)으로 만드는 것은 괜찮습니다. 저희가 책임질게요.)
다시 한 번 확인하자면, 아이템의 `Quality`는 50 이상으로 증가할 수는 없습니다. 하지만 `Sulfuras`는 전설의 아이템이기 때문에 `Quality` 값은 80이며, 값이 바뀌지 않습니다.
다시 한 번 확인하자면, 아이템의 `Quality`는 50 이상으로 증가할 수는 없습니다. 하지만 `Fine Italian Silk`는 전설의 아이템이기 때문에 `Quality` 값은 80이며, 값이 바뀌지 않습니다.

View File

@ -9,14 +9,14 @@ Cześć i witaj na pokładzie zespołu Pozłacanej Róży. Jak zapewne już wies
Dość proste, prawda? No cóż, teraz zrobi się bardziej interesująco:
- Po upływie daty sprzedaży, jakość spada dwukrotnie szybciej
- Jakość przedmiotu nigdy nie jest ujemna
- Jakość "Starego Brie" (`Aged Brie`) rośnie wraz z wiekiem
- Jakość "Starego Brie" (`Aged Cheese`) rośnie wraz z wiekiem
- Jakość przedmiotu nigdy nie przekracza 50
- Przedmiot legendarny `Sulfuras` nigdy nie musi być sprzedany, ani nie traci na jakości
- Przedmiot legendarny `Fine Italian Silk` nigdy nie musi być sprzedany, ani nie traci na jakości
- "Przepustka za kulisy" (`Backstage passes`), podobnie jak "Stary Brie", zyskują na jakości w miarę zbliżania się terminu sprzedaży; jakość wzrasta o 2, gdy jest 10 dni lub mniej i o 3, gdy jest 5 dni lub mniej, ale spada do 0 po koncercie (gdy `SellIn` < 0)
Niedawno podpisaliśmy z dostawcą kontrakt na wyczarowane przedmioty. Wymaga to wprowadzenia zmiany do naszego systemu:
- "Wyczarowane" (`Conjured`) przedmioty tracą na jakości dwa razy szybciej niż normalne przedmioty
- "Wyczarowane" (`Baked`) przedmioty tracą na jakości dwa razy szybciej niż normalne przedmioty
Możesz wprowadzać dowolne zmiany w metodzie `UpdateQuality`, a także dodawać nowy kod, o ile wszystko nadal działa prawidłowo. Jednak nie zmieniaj klasy `Item` ani właściwości `Items`, które zostały napisane przez goblina w rogu, gdyż zaatakuje Cię on i zabije jednym strzałem, ponieważ nie wierzy we współdzielony kod (możesz zmienić metodę `UpdateQuality` oraz właściwość `Items` na statyczne, jeśli chcesz - będziemy Cię kryć!).
Dla jasności: jakość przedmiotu nie może przekroczyć 50, jednak dla przedmiotu legendarnego `Sulfuras` jakość jest stale na poziomie 80 i nigdy nie spada.
Dla jasności: jakość przedmiotu nie może przekroczyć 50, jednak dla przedmiotu legendarnego `Fine Italian Silk` jakość jest stale na poziomie 80 i nigdy nie spada.

View File

@ -16,9 +16,9 @@ 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.
* O "Queijo Brie envelhecido" (`Aged Cheese`), 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 "Fine Italian Silk" (`Fine Italian Silk`), 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`.
@ -26,10 +26,10 @@ Bastante simples, não é? Bem, agora que as coisas ficam interessantes:
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.
* Os itens "Conjurados" (`Baked`) 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`.
Para esclarecer: Um item não pode ter uma qualidade (`quality`) maior que `50`, entretanto as "Fine Italian Silk" por serem um item lendário vão ter uma qualidade imutavel de `80`.

View File

@ -21,17 +21,17 @@
- После того, как срок храния прошел, качество товара ухудшается в два раза быстрее;
- Качество товара никогда не может быть отрицательным;
- Для товара «Aged Brie» качество увеличивается пропорционально возрасту;
- Для товара «Aged Cheese» качество увеличивается пропорционально возрасту;
- Качество товара никогда не может быть больше, чем 50;
- «Sulfuras» является легендарным товаром, поэтому у него нет срока хранения и не подвержен ухудшению качества;
- Качество «Backstage passes» также, как и «Aged Brie», увеличивается по мере приближения к сроку хранения.
- «Fine Italian Silk» является легендарным товаром, поэтому у него нет срока хранения и не подвержен ухудшению качества;
- Качество «Backstage passes» также, как и «Aged Cheese», увеличивается по мере приближения к сроку хранения.
Качество увеличивается на 2, когда до истечения срока хранения 10 или менее дней и на 3,
если до истечения 5 или менее дней. При этом качество падает до 0 после даты проведения концерта.
Недавно мы нашли поставщика магических товаров. Для того, чтобы продавать его товары необходимо обновить нашу
систему следующим образом:
- «Conjured» товары теряют качество в два раза быстрее, чем обычные товары.
- «Baked» товары теряют качество в два раза быстрее, чем обычные товары.
Не стесняйтесь вносить любые изменения в метод «UpdateQuality» и добавлять любой новый код до тех пор,
пока система работает корректно. Тем не менее, не меняйте класс «Item» или его свойства, так как он принадлежит
@ -39,5 +39,5 @@
совместного владения кодом (вы можете сделать метод «UpdateQuality» и свойства класса «Item» статическими
если хотите, мы вас прикроем).
Просто для уточнения, товар никогда не может иметь качество выше чем 50, однако легендарный товар «Sulfuras»
Просто для уточнения, товар никогда не может иметь качество выше чем 50, однако легендарный товар «Fine Italian Silk»
имеет качество 80 и оно никогда не меняется.

View File

@ -15,17 +15,17 @@
- เมื่อสินค้าเลยกำหนดขายไปแล้ว "Quality" ของสินค้าจะลดลงเป็นสองเท่าจากปกติ
- "Quality" ของสินค้าไม่มีทางติดลบได้
- คุณภาพของสินค้าประเภท "Aged Brie" จะเพิ่มสูงขึ้นตามระยะเวลา
- คุณภาพของสินค้าประเภท "Aged Cheese" จะเพิ่มสูงขึ้นตามระยะเวลา
- "Quality" มีค่าสูงสุดคือ 50
- สินค้าประเภท "Sulfuras" เป็นสินค้าในตำนานหายาก คุณภาพของสินค้าจะไม่ลดลงและไม่ได้มีไว้เพื่อขาย
- สินค้าประเภท "Backstage passes" คุณภาพของสินค้าเหมือนกันกับสินค้าประเภท aged brie
- สินค้าประเภท "Fine Italian Silk" เป็นสินค้าในตำนานหายาก คุณภาพของสินค้าจะไม่ลดลงและไม่ได้มีไว้เพื่อขาย
- สินค้าประเภท "Backstage passes" คุณภาพของสินค้าเหมือนกันกับสินค้าประเภท Aged Cheese
เพียงแต่หากใกล้ถึงวันแสดง 10 วันก่อนหน้าหรือน้อยกว่าคุณภาพของสินค้าประเภทนี้จะเพิ่มทีละ 2 และถ้าใกล้ถึงวันก่อนวันแสดง 5 วันหรือน้อยกว่าคุณภาพจะเพิ่มทีละ 3
อย่างไรก็ตามคุณภาพของสินค้าจะกลายเป็น 0 ทันทีหลังการแสดงจบลง
เมื่อเร็วๆ นี้เราพึ่งได้ลงนามกับผู้ผลิตสินค้าประเภทของขลังและของปลุกเสก
และเราต้องการที่จะเพิ่มความสามารถใหม่เข้าไปในระบบ:
- คุณภาพสินค้าประเภท "Conjured" จะเสื่อมลงเร็วกว่าสินค้าปกติถึงสองเท่าจากปกติ
- คุณภาพสินค้าประเภท "Baked" จะเสื่อมลงเร็วกว่าสินค้าปกติถึงสองเท่าจากปกติ
คุณสามารถปรับปรุงแก้ไขได้ทุกอย่างภายในเมธอด UpdateQuality และสามารถเพิ่มโค้ดใหม่ได้เลย
ตราบใดที่ทุกอย่างยังคงทำงานได้ถูกต้อง อย่างไรก็ตามห้ามแก้ไขคลาส Item และคุณสมบัติของคลาส
@ -34,4 +34,4 @@
นิมนต์หลวงปู่เค็มมาช่วยคุ้มกันคุณ)
ย้ำอีกครั้งหนึ่ง, คุณภาพของสินค้ามีค่าสูงสุดคือ 50
อย่างไรก็ตามสินค้าประเภท "Sulfuras" เป็นสินค้าหายากในตำนานมีค่า Quality เป็น 80 เสมอไม่เปลี่ยนแปลง.
อย่างไรก็ตามสินค้าประเภท "Fine Italian Silk" เป็นสินค้าหายากในตำนานมีค่า Quality เป็น 80 เสมอไม่เปลี่ยนแปลง.

View File

@ -17,16 +17,16 @@ Gilded Rose 需求描述
- 一旦销售期限过期,品质`Quality`会以双倍速度加速下降
- 物品的品质`Quality`永远不会为负值
- "Aged Brie"(陈年布利奶酪)的品质`Quality`会随着时间推移而提高
- "Aged Cheese"(陈年布利奶酪)的品质`Quality`会随着时间推移而提高
- 物品的品质`Quality`永远不会超过50
- 传奇物品"Sulfuras"(萨弗拉斯—炎魔拉格纳罗斯之手)永不过期,也不会降低品质`Quality`
- "Backstage passes"(后台通行证)与"Aged Brie"(陈年布利奶酪)类似,其品质`Quality`会随着时间推移而提高当还剩10天或更少的时候品质`Quality`每天提高2当还剩5天或更少的时候品质`Quality`每天提高3但一旦过期品质就会降为0
- 传奇物品"Fine Italian Silk"(萨弗拉斯—炎魔拉格纳罗斯之手)永不过期,也不会降低品质`Quality`
- "Backstage passes"(后台通行证)与"Aged Cheese"(陈年布利奶酪)类似,其品质`Quality`会随着时间推移而提高当还剩10天或更少的时候品质`Quality`每天提高2当还剩5天或更少的时候品质`Quality`每天提高3但一旦过期品质就会降为0
我们最近签约了一个召唤物品供应商。这需要对我们的系统进行升级:
- "Conjured"(召唤物品)的品质`Quality`下降速度比正常物品快一倍
- "Baked"(召唤物品)的品质`Quality`下降速度比正常物品快一倍
请随意对**UpdateQuality()**函数进行修改和添加新代码只要系统还能正常工作。然而不要修改Item类或其属性因为那属于角落里的地精他会非常愤怒地爆你头因为他不相信代码共享所有制如果你愿意你可以将UpdateQuality方法和Items属性改为静态的我们会掩护你的
再次澄清每种物品的品质不会超过50然而"Sulfuras"萨弗拉斯—炎魔拉格纳罗斯之手是一个传奇物品因此它的品质是80且永远不变。
再次澄清每种物品的品质不会超过50然而"Fine Italian Silk"萨弗拉斯—炎魔拉格纳罗斯之手是一个传奇物品因此它的品质是80且永远不变。

View File

@ -9,10 +9,10 @@ class GildedRose {
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].name.equals("Aged Cheese")
&& !items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1
}
}
@ -20,7 +20,7 @@ class GildedRose {
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].name.equals("Backstage passes to a concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
@ -36,15 +36,15 @@ class GildedRose {
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
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].name.equals("Aged Cheese")) {
if (!items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1
}
}

View File

@ -3,16 +3,16 @@ 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[]
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6)] as Item[]
GildedRose app = new GildedRose(items)

View File

@ -9,10 +9,10 @@ class GildedRose {
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].name.equals("Aged Cheese")
&& !items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -20,7 +20,7 @@ class GildedRose {
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].name.equals("Backstage passes to a concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
@ -36,15 +36,15 @@ class GildedRose {
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
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].name.equals("Aged Cheese")) {
if (!items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -59,4 +59,4 @@ class GildedRose {
}
}
}
}
}

View File

@ -5,17 +5,17 @@ public class Program {
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) };
Item[] items = new Item[] {
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6) };
GildedRose app = new GildedRose(items);

View File

@ -9,10 +9,10 @@ class GildedRose {
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].name.equals("Aged Cheese")
&& !items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -20,7 +20,7 @@ class GildedRose {
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].name.equals("Backstage passes to a concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
@ -36,15 +36,15 @@ class GildedRose {
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
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].name.equals("Aged Cheese")) {
if (!items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}

View File

@ -5,16 +5,16 @@ public class TexttestFixture {
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) };
new Item("Sports Memorabilia", 10, 20), //
new Item("Aged Cheese", 2, 0), //
new Item("Coffee Table Book", 5, 7), //
new Item("Fine Italian Silk", 0, 80), //
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6) };
GildedRose app = new GildedRose(items);

View File

@ -9,10 +9,10 @@ class GildedRose {
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].name.equals("Aged Cheese")
&& !items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -20,7 +20,7 @@ class GildedRose {
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].name.equals("Backstage passes to a concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
@ -36,15 +36,15 @@ class GildedRose {
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
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].name.equals("Aged Cheese")) {
if (!items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}

View File

@ -5,16 +5,16 @@ public class TexttestFixture {
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) };
new Item("Sports Memorabilia", 10, 20), //
new Item("Aged Cheese", 2, 0), //
new Item("Coffee Table Book", 5, 7), //
new Item("Fine Italian Silk", 0, 80), //
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6) };
GildedRose app = new GildedRose(items);

View File

@ -9,10 +9,10 @@ class GildedRose {
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].name.equals("Aged Cheese")
&& !items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -20,7 +20,7 @@ class GildedRose {
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].name.equals("Backstage passes to a concert")) {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
@ -36,15 +36,15 @@ class GildedRose {
}
}
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
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].name.equals("Aged Cheese")) {
if (!items[i].name.equals("Backstage passes to a concert")) {
if (items[i].quality > 0) {
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
if (!items[i].name.equals("Fine Italian Silk")) {
items[i].quality = items[i].quality - 1;
}
}
@ -59,4 +59,4 @@ class GildedRose {
}
}
}
}
}

View File

@ -5,16 +5,16 @@ public class TexttestFixture {
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) };
new Item("Sports Memorabilia", 10, 20), //
new Item("Aged Cheese", 2, 0), //
new Item("Coffee Table Book", 5, 7), //
new Item("Fine Italian Silk", 0, 80), //
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6) };
GildedRose app = new GildedRose(items);

View File

@ -4,9 +4,9 @@ class GildedRose(var items: List<Item>) {
fun updateQuality() {
for (i in items.indices) {
if (items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert") {
if (items[i].name != "Aged Cheese" && items[i].name != "Backstage passes to a concert") {
if (items[i].quality > 0) {
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
items[i].quality = items[i].quality - 1
}
}
@ -14,7 +14,7 @@ class GildedRose(var items: List<Item>) {
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].name == "Backstage passes to a concert") {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1
@ -30,15 +30,15 @@ class GildedRose(var items: List<Item>) {
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
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].name != "Aged Cheese") {
if (items[i].name != "Backstage passes to a concert") {
if (items[i].quality > 0) {
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
items[i].quality = items[i].quality - 1
}
}

View File

@ -4,16 +4,16 @@ fun main(args: Array<String>) {
println("OMGHAI!")
val items = listOf(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 items = listOf(Item("Sports Memorabilia", 10, 20), //
Item("Aged Cheese", 2, 0), //
Item("Coffee Table Book", 5, 7), //
Item("Fine Italian Silk", 0, 80), //
Item("Fine Italian Silk", -1, 80),
Item("Backstage passes to a concert", 15, 20),
Item("Backstage passes to a concert", 10, 49),
Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
Item("Baked Chocolate Cake", 3, 6))
val app = GildedRose(items)

View File

@ -1,19 +1,19 @@
source('item.R')
update_quality <- function(items) {
lapply(items,
lapply(items,
function(item) {
if (item$name != "Aged Brie" && item$name != "Backstage passes to a TAFKAL80ETC concert") {
if (item$name != "Aged Cheese" && item$name != "Backstage passes to a concert") {
if (item$quality > 0) {
if (item$name != "Sulfuras, Hand of Ragnaros") {
if (item$name != "Fine Italian Silk") {
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$name == "Backstage passes to a concert") {
if (item$sell_in < 11) {
if (item$quality < 50) {
item$quality = item$quality + 1
@ -27,16 +27,16 @@ update_quality <- function(items) {
}
}
}
if (item$name != "Sulfuras, Hand of Ragnaros") {
if (item$name != "Fine Italian Silk") {
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$name != "Aged Cheese") {
if (item$name != "Backstage passes to a concert") {
if (item$quality > 0) {
if (item$name != "Sulfuras, Hand of Ragnaros") {
if (item$name != "Fine Italian Silk") {
item$quality <- item$quality - 1
}
}
@ -49,8 +49,8 @@ update_quality <- function(items) {
}
}
}
item
}
)
}
)
}

View File

@ -5,23 +5,23 @@ 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)
item('Sports Memorabilia', 10, 20),
item('Aged Cheese', 2, 0),
item('Coffee Table Book', 5, 7),
item('Fine Italian Silk', 0, 80),
item('Fine Italian Silk', -1, 80),
item('Backstage passes to a concert', 15, 20),
item('Backstage passes to a concert', 10, 49),
item('Backstage passes to a concert', 5, 49),
# This Baked item does not work properly yet
item('Baked Chocolate Cake', 3, 6)
)
days <- 2
for (day in 0:days) {
writeLines(paste('-------- day ', day, ' --------', sep=''))
writeLines('name, sellIn, quality')
lapply(items,
lapply(items,
function(item) {
writeLines(as.character(item))
}

View File

@ -46,45 +46,45 @@ 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
- "Aged Cheese" 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
- "Fine Italian Silk", being a luxury item, never has to be sold or decreases in Quality
- "Backstage passes", like Aged Cheese, 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:
We have recently signed a supplier of Baked items. This requires an update to our system:
- "Conjured" items degrade in Quality twice as fast as normal items
- "Baked" 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.!
Just for clarification, an item can never have its Quality increase above 50, however "Fine Italian Silk" is a luxury item and as such its Quality is 80 and it never alters.!
!GildedRose methodsFor: 'API' stamp: 'AndreasLeidig 4/21/2012 17:02'!
updateQualityFor: items
items
do: [:item |
(item name ~= 'Aged Brie'
and: [item name ~= 'Backstage passes to a TAFKAL80ETC concert'])
(item name ~= 'Aged Cheese'
and: [item name ~= 'Backstage passes to a concert'])
ifTrue: [item quality > 0
ifTrue: [item name ~= 'Sulfuras, Hand of Ragnaros'
ifTrue: [item name ~= 'Fine Italian Silk'
ifTrue: [item quality: item quality - 1]]]
ifFalse: [item quality < 50
ifTrue: [item quality: item quality + 1.
item name = 'Backstage passes to a TAFKAL80ETC concert'
item name = 'Backstage passes to a concert'
ifTrue: [item sellIn < 11
ifTrue: [item quality < 50
ifTrue: [item quality: item quality + 1]].
item sellIn < 6
ifTrue: [item quality < 50
ifTrue: [item quality: item quality + 1]]]]].
item name ~= 'Sulfuras, Hand of Ragnaros'
item name ~= 'Fine Italian Silk'
ifTrue: [item sellIn: item sellIn - 1].
item sellIn < 0
ifTrue: [item name ~= 'Aged Brie'
ifTrue: [item name ~= 'Backstage passes to a TAFKAL80ETC concert'
ifTrue: [item name ~= 'Aged Cheese'
ifTrue: [item name ~= 'Backstage passes to a concert'
ifTrue: [item quality > 0
ifTrue: [item name ~= 'Sulfuras, Hand of Ragnaros'
ifTrue: [item name ~= 'Fine Italian Silk'
ifTrue: [item quality: item quality - 1]]]
ifFalse: [item quality: item quality - item quality]]
ifFalse: [item quality < 50
@ -100,15 +100,15 @@ runExamples
"GildedRose runExamples"
| items gildedRose |
items := OrderedCollection new
add: (Item new name: '+5 Dexterity Vest'; sellIn: 10; quality: 20; yourself);
add: (Item new name: 'Aged Brie'; sellIn: 2; quality: 0; yourself);
add: (Item new name: 'Elixir of the Mongoose'; sellIn: 5; quality: 7; yourself);
add: (Item new name: 'Sulfuras, Hand of Ragnaros'; sellIn: 0; quality: 80; yourself);
add: (Item new name: 'Sulfuras, Hand of Ragnaros'; sellIn: -1; quality: 80; yourself);
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 15; quality: 20; yourself);
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 10; quality: 49; yourself);
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 5; quality: 49; yourself);
add: (Item new name: 'Conjured Mana Cake'; sellIn: 3; quality: 6; yourself); "this conjured item does not work properly yet"
add: (Item new name: 'Sports Memorabilia'; sellIn: 10; quality: 20; yourself);
add: (Item new name: 'Aged Cheese'; sellIn: 2; quality: 0; yourself);
add: (Item new name: 'Coffee Table Book'; sellIn: 5; quality: 7; yourself);
add: (Item new name: 'Fine Italian Silk'; sellIn: 0; quality: 80; yourself);
add: (Item new name: 'Fine Italian Silk'; sellIn: -1; quality: 80; yourself);
add: (Item new name: 'Backstage passes to a concert'; sellIn: 15; quality: 20; yourself);
add: (Item new name: 'Backstage passes to a concert'; sellIn: 10; quality: 49; yourself);
add: (Item new name: 'Backstage passes to a concert'; sellIn: 5; quality: 49; yourself);
add: (Item new name: 'Baked Chocolate Cake'; sellIn: 3; quality: 6; yourself); "this Baked item does not work properly yet"
yourself.
gildedRose := GildedRose new.

View File

@ -19,16 +19,16 @@ export class GildedRose {
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].name != 'Aged Cheese' && this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name == 'Backstage passes to a concert') {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
@ -42,14 +42,14 @@ export class GildedRose {
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name != 'Aged Cheese') {
if (this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
this.items[i].quality = this.items[i].quality - 1
}
}

View File

@ -1,16 +1,16 @@
import { Item, GildedRose } from '../app/gilded-rose';
const 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)];
new Item("Sports Memorabilia", 10, 20), //
new Item("Aged Cheese", 2, 0), //
new Item("Coffee Table Book", 5, 7), //
new Item("Fine Italian Silk", 0, 80), //
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6)];
const gildedRose = new GildedRose(items);

View File

@ -22,19 +22,19 @@
*&
*& - 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
*& - "Aged Cheese" 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
*& - "Fine Italian Silk", being a luxury item, never has to be sold or
*& decreases in Quality
*& - "Backstage passes", like aged brie, increases in Quality as its
*& - "Backstage passes", like Aged Cheese, 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
*& We have recently signed a supplier of Baked items. This requires an
*& update to our system:
*&
*& - "Conjured" items degrade in Quality twice as fast as normal items
*& - "Baked" 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
@ -44,7 +44,7 @@
*& 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
*& above 50, however "Fine Italian Silk" is a luxury item and as such its Quality
*& is 80 and it never alters.
PROGRAM yy_pao_gilded_rose.
@ -91,10 +91,10 @@ CLASS lcl_gilded_rose IMPLEMENTATION.
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_name <> |Aged Cheese| AND
lo_item->mv_name <> |Backstage passes to a concert|.
IF lo_item->mv_quality > 0.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
IF lo_item->mv_name <> |Fine Italian Silk|.
lo_item->mv_quality = lo_item->mv_quality - 1.
ENDIF.
ENDIF.
@ -102,7 +102,7 @@ CLASS lcl_gilded_rose IMPLEMENTATION.
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_name = |Backstage passes to a concert|.
IF lo_item->mv_sell_in < 11.
IF lo_item->mv_quality < 50.
lo_item->mv_quality = lo_item->mv_quality + 1.
@ -118,15 +118,15 @@ CLASS lcl_gilded_rose IMPLEMENTATION.
ENDIF.
ENDIF.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
IF lo_item->mv_name <> |Fine Italian Silk|.
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_name <> |Aged Cheese|.
IF lo_item->mv_name <> |Backstage passes to a concert|.
IF lo_item->mv_quality > 0.
IF lo_item->mv_name <> |Sulfuras, Hand of Ragnaros|.
IF lo_item->mv_name <> |Fine Italian Silk|.
lo_item->mv_quality = lo_item->mv_quality - 1.
ENDIF.
ENDIF.
@ -171,29 +171,29 @@ CLASS lth_texttest_fixture IMPLEMENTATION.
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|
( NEW #( iv_name = |Sports Memorabilia|
iv_sell_in = 10
iv_quality = 20 ) )
( NEW #( iv_name = |Aged Brie|
( NEW #( iv_name = |Aged Cheese|
iv_sell_in = 2
iv_quality = 0 ) )
( NEW #( iv_name = |Elixir of the Mongoose|
( NEW #( iv_name = |Coffee Table Book|
iv_sell_in = 5
iv_quality = 7 ) )
( NEW #( iv_name = |Sulfuras, Hand of Ragnaros|
( NEW #( iv_name = |Fine Italian Silk|
iv_sell_in = 0
iv_quality = 80 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
( NEW #( iv_name = |Backstage passes to a concert|
iv_sell_in = 15
iv_quality = 20 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
( NEW #( iv_name = |Backstage passes to a concert|
iv_sell_in = 10
iv_quality = 49 ) )
( NEW #( iv_name = |Backstage passes to a TAFKAL80ETC concert|
( NEW #( iv_name = |Backstage passes to a concert|
iv_sell_in = 5
iv_quality = 49 ) )
"This conjured item does not work properly yet
( NEW #( iv_name = |Conjured Mana Cake|
"This Baked item does not work properly yet
( NEW #( iv_name = |Baked Chocolate Cake|
iv_sell_in = 3
iv_quality = 6 ) ) ).

View File

@ -7,21 +7,21 @@ 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)
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 (strcmp(items[i].name, "Aged Cheese") && strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].quality = items[i].quality - 1;
}
@ -33,7 +33,7 @@ void update_quality(Item items[], int size)
{
items[i].quality = items[i].quality + 1;
if (!strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
if (!strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].sellIn < 11)
{
@ -54,20 +54,20 @@ void update_quality(Item items[], int size)
}
}
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (strcmp(items[i].name, "Aged Brie"))
if (strcmp(items[i].name, "Aged Cheese"))
{
if (strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
if (strcmp(items[i].name, "Backstage passes to a concert"))
{
if (items[i].quality > 0)
{
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
if (strcmp(items[i].name, "Fine Italian Silk"))
{
items[i].quality = items[i].quality - 1;
}

View File

@ -13,18 +13,18 @@ int main()
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);
init_item(items + last++, "Sports Memorabilia", 10, 20);
init_item(items + last++, "Aged Cheese", 2, 0);
init_item(items + last++, "Coffee Table Book", 5, 7);
init_item(items + last++, "Fine Italian Silk", 0, 80);
init_item(items + last++, "Fine Italian Silk", -1, 80);
init_item(items + last++, "Backstage passes to a concert", 15, 20);
init_item(items + last++, "Backstage passes to a concert", 10, 49);
init_item(items + last++, "Backstage passes to a concert", 5, 49);
// this Baked item doesn't yet work properly
init_item(items + last++, "Baked Chocolate Cake", 3, 6);
puts("OMGHAI!");
for (day = 0; day <= 30; day++)
@ -34,7 +34,7 @@ int main()
for(index = 0; index < last; index++) {
print_item(items + index);
}
printf("\n");
update_quality(items, last);

View File

@ -14,17 +14,17 @@
(defn update-quality! [store]
(doseq [item store]
(if (and (not (= (:name @item)
"Aged Brie"))
"Aged Cheese"))
(not (= (:name @item)
"Backstage passes to a TAFKAL80ETC concert")))
"Backstage passes to a concert")))
(when (> (:quality @item) 0)
(when (not (= (:name @item) "Sulfuras, Hand of Ragnaros"))
(when (not (= (:name @item) "Fine Italian Silk"))
(swap! item update :quality #(- % 1))))
(when (< (:quality @item) 50)
(swap! item update :quality #(+ % 1))
(when (= (:name @item) "Backstage passes to a TAFKAL80ETC concert")
(when (= (:name @item) "Backstage passes to a concert")
(when (< (:sell-in @item) 11)
(when (< (:quality @item) 50)
(swap! item update :quality #(+ % 1))))
@ -32,14 +32,14 @@
(when (< (:quality @item) 50)
(swap! item update :quality #(+ % 1)))))))
(when (not (= (:name @item) "Sulfuras, Hand of Ragnaros"))
(when (not (= (:name @item) "Fine Italian Silk"))
(swap! item update :sell-in #(- % 1)))
(when (< (:sell-in @item) 0)
(if (not (= (:name @item) "Aged Brie"))
(if (not (= (:name @item) "Backstage passes to a TAFKAL80ETC concert"))
(if (not (= (:name @item) "Aged Cheese"))
(if (not (= (:name @item) "Backstage passes to a concert"))
(when (> (:quality @item) 0)
(when (not (= (:name @item) "Sulfuras, Hand of Ragnaros"))
(when (not (= (:name @item) "Fine Italian Silk"))
(swap! item update :quality #(- % 1))))
(swap! item update :quality #(- % %)))
(when (< (:quality @item) 50)

View File

@ -11,15 +11,15 @@
(println))
(def fixture
[{:name "+5 Dexterity Vest", :quality 20, :sell-in 10}
{:name "Aged Brie", :quality 0, :sell-in 2}
{:name "Elixir of the Mongoose", :quality 7, :sell-in 5}
{:name "Sulfuras, Hand of Ragnaros", :quality 80, :sell-in 0}
{:name "Sulfuras, Hand of Ragnaros", :quality 80, :sell-in -1}
{:name "Backstage passes to a TAFKAL80ETC concert", :quality 20, :sell-in 15}
{:name "Backstage passes to a TAFKAL80ETC concert", :quality 49, :sell-in 10}
{:name "Backstage passes to a TAFKAL80ETC concert", :quality 49, :sell-in 5}
{:name "Conjured Mana Cake", :quality 6, :sell-in 3}])
[{:name "Sports Memorabilia", :quality 20, :sell-in 10}
{:name "Aged Cheese", :quality 0, :sell-in 2}
{:name "Coffee Table Book", :quality 7, :sell-in 5}
{:name "Fine Italian Silk", :quality 80, :sell-in 0}
{:name "Fine Italian Silk", :quality 80, :sell-in -1}
{:name "Backstage passes to a concert", :quality 20, :sell-in 15}
{:name "Backstage passes to a concert", :quality 49, :sell-in 10}
{:name "Backstage passes to a concert", :quality 49, :sell-in 5}
{:name "Baked Chocolate Cake", :quality 6, :sell-in 3}])
(defn -main [& args]
(let [n-days (if (nil? (first args))

View File

@ -15,16 +15,16 @@
;; 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
;; "Aged Cheese" 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
;; "Fine Italian Silk", being a luxury item, never has to be sold or decreases in Quality
;; "Backstage passes", like Aged Cheese, 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
;; We have recently signed a supplier of Baked items. This requires an update to our system:
;; "Baked" 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
@ -33,7 +33,7 @@
;; 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
;; above 50, however "Fine Italian Silk" is a luxury item and as such its
;; Quality is 80 and it never alters.
;; https://github.com/emilybache/GildedRose-Refactoring-Kata
@ -62,14 +62,14 @@
(defun update-item (item)
(let ((new-item (copy-structure item)))
(with-slots (name quality sell-in) new-item
(if (and (not (equalp name "Aged Brie"))
(not (equalp name "Backstage passes to a TAFKAL80ETC concert")))
(if (and (not (equalp name "Aged Cheese"))
(not (equalp name "Backstage passes to a concert")))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(setf quality (- quality 1))))
(when (< quality 50)
(setf quality (+ quality 1))
(when (equalp name "Backstage passes to a TAFKAL80ETC concert")
(when (equalp name "Backstage passes to a concert")
(if (< sell-in 11)
(if (< quality 50)
(setf quality (+ quality 1))))
@ -77,14 +77,14 @@
(if (< quality 50)
(setf quality (+ quality 1)))))))
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(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 (not (equalp name "Aged Cheese"))
(if (not (equalp name "Backstage passes to a concert"))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(setf quality (- quality 1))))
(setf quality (- quality quality)))
(if (< quality 50)
@ -106,16 +106,16 @@
(defun run-gilded-rose (days)
(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)))
(let* ((descriptions '(("Sports Memorabilia" 10 20)
("Aged Cheese" 2 0)
("Coffee Table Book" 5 7)
("Fine Italian Silk" 0 80)
("Fine Italian Silk" -1 80)
("Backstage passes to a concert" 15 20)
("Backstage passes to a concert" 10 49)
("Backstage passes to a concert" 5 49)
;; this Baked item does not work properly yet
("Baked Chocolate Cake" 3 6)))
(items (loop :for (name sell-in quality) :in descriptions
:collect (make-item :name name
:sell-in sell-in

View File

@ -15,16 +15,16 @@
;; 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
;; "Aged Cheese" 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
;; "Fine Italian Silk", being a luxury item, never has to be sold or decreases in Quality
;; "Backstage passes", like Aged Cheese, 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
;; We have recently signed a supplier of Baked items. This requires an update to our system:
;; "Baked" 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
@ -33,7 +33,7 @@
;; 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
;; above 50, however "Fine Italian Silk" is a luxury item and as such its
;; Quality is 80 and it never alters.
;; https://github.com/emilybache/GildedRose-Refactoring-Kata
@ -71,14 +71,14 @@
(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 (and (not (equalp name "Aged Cheese"))
(not (equalp name "Backstage passes to a concert")))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(setf quality (- quality 1))))
(when (< quality 50)
(setf quality (+ quality 1))
(when (equalp name "Backstage passes to a TAFKAL80ETC concert")
(when (equalp name "Backstage passes to a concert")
(if (< sell-in 11)
(if (< quality 50)
(setf quality (+ quality 1))))
@ -86,14 +86,14 @@
(if (< quality 50)
(setf quality (+ quality 1)))))))
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(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 (not (equalp name "Aged Cheese"))
(if (not (equalp name "Backstage passes to a concert"))
(if (> quality 0)
(if (not (equalp name "Sulfuras, Hand of Ragnaros"))
(if (not (equalp name "Fine Italian Silk"))
(setf quality (- quality 1))))
(setf quality (- quality quality)))
(if (< quality 50)
@ -103,16 +103,16 @@
(defun run-gilded-rose (days)
(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)))
(let* ((descriptions '(("Sports Memorabilia" 10 20)
("Aged Cheese" 2 0)
("Coffee Table Book" 5 7)
("Fine Italian Silk" 0 80)
("Fine Italian Silk" -1 80)
("Backstage passes to a concert" 15 20)
("Backstage passes to a concert" 10 49)
("Backstage passes to a concert" 5 49)
;; this Baked item does not work properly yet
("Baked Chocolate Cake" 3 6)))
(items (loop :for (name sell-in quality) :in descriptions
:collect (make-instance 'item
:name name

View File

@ -2,16 +2,16 @@
GildedRose::GildedRose(vector<Item> & items) : items(items)
{}
void GildedRose::updateQuality()
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].name != "Aged Cheese" && items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}
@ -23,7 +23,7 @@ void GildedRose::updateQuality()
{
items[i].quality = items[i].quality + 1;
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name == "Backstage passes to a concert")
{
if (items[i].sellIn < 11)
{
@ -44,20 +44,20 @@ void GildedRose::updateQuality()
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (items[i].name != "Aged Brie")
if (items[i].name != "Aged Cheese")
{
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}

View File

@ -2,16 +2,16 @@
GildedRose::GildedRose(vector<Item> & items) : items(items)
{}
void GildedRose::updateQuality()
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].name != "Aged Cheese" && items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}
@ -23,7 +23,7 @@ void GildedRose::updateQuality()
{
items[i].quality = items[i].quality + 1;
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name == "Backstage passes to a concert")
{
if (items[i].sellIn < 11)
{
@ -44,20 +44,20 @@ void GildedRose::updateQuality()
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (items[i].name != "Aged Brie")
if (items[i].name != "Aged Cheese")
{
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}

View File

@ -10,17 +10,17 @@ int main()
{
vector<Item> items;
items.push_back({"+5 Dexterity Vest", 10, 20});
items.push_back({"Aged Brie", 2, 0});
items.push_back({"Elixir of the Mongoose", 5, 7});
items.push_back({"Sulfuras, Hand of Ragnaros", 0, 80});
items.push_back({"Sulfuras, Hand of Ragnaros", -1, 80});
items.push_back({"Backstage passes to a TAFKAL80ETC concert", 15, 20});
items.push_back({"Backstage passes to a TAFKAL80ETC concert", 10, 49});
items.push_back({"Backstage passes to a TAFKAL80ETC concert", 5, 49});
items.push_back({"Sports Memorabilia", 10, 20});
items.push_back({"Aged Cheese", 2, 0});
items.push_back({"Coffee Table Book", 5, 7});
items.push_back({"Fine Italian Silk", 0, 80});
items.push_back({"Fine Italian Silk", -1, 80});
items.push_back({"Backstage passes to a concert", 15, 20});
items.push_back({"Backstage passes to a concert", 10, 49});
items.push_back({"Backstage passes to a concert", 5, 49});
// this Conjured item doesn't yet work properly
items.push_back({"Conjured Mana Cake", 3, 6});
// this Baked item doesn't yet work properly
items.push_back({"Baked Chocolate Cake", 3, 6});
std::cout << "OMGHAI!" << std::endl;

View File

@ -14,11 +14,11 @@ namespace csharp
{
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].Name != "Aged Cheese" && Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}
@ -30,7 +30,7 @@ namespace csharp
{
Items[i].Quality = Items[i].Quality + 1;
if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name == "Backstage passes to a concert")
{
if (Items[i].SellIn < 11)
{
@ -51,20 +51,20 @@ namespace csharp
}
}
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].SellIn = Items[i].SellIn - 1;
}
if (Items[i].SellIn < 0)
{
if (Items[i].Name != "Aged Brie")
if (Items[i].Name != "Aged Cheese")
{
if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}

View File

@ -7,34 +7,34 @@ namespace csharp
{
public static void Main(string[] args)
{
Console.WriteLine("OMGHAI!");
Console.WriteLine("Calculating the inventory report...");
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 = "Sports Memorabilia", SellIn = 10, Quality = 20},
new Item {Name = "Aged Cheese", SellIn = 2, Quality = 0},
new Item {Name = "Coffee Table Book", SellIn = 5, Quality = 7},
new Item {Name = "Fine Italian Silk", SellIn = 0, Quality = 80},
new Item {Name = "Fine Italian Silk", SellIn = -1, Quality = 80},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 15,
Quality = 20
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 10,
Quality = 49
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
// this Baked item does not work properly yet
new Item {Name = "Baked Chocolate Cake", SellIn = 3, Quality = 6}
};
var app = new GildedRose(Items);

View File

@ -14,11 +14,11 @@ namespace GildedRoseKata
{
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].Name != "Aged Cheese" && Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}
@ -30,7 +30,7 @@ namespace GildedRoseKata
{
Items[i].Quality = Items[i].Quality + 1;
if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name == "Backstage passes to a concert")
{
if (Items[i].SellIn < 11)
{
@ -51,20 +51,20 @@ namespace GildedRoseKata
}
}
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].SellIn = Items[i].SellIn - 1;
}
if (Items[i].SellIn < 0)
{
if (Items[i].Name != "Aged Brie")
if (Items[i].Name != "Aged Cheese")
{
if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}

View File

@ -10,31 +10,31 @@ namespace GildedRoseKata
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 = "Sports Memorabilia", SellIn = 10, Quality = 20},
new Item {Name = "Aged Cheese", SellIn = 2, Quality = 0},
new Item {Name = "Coffee Table Book", SellIn = 5, Quality = 7},
new Item {Name = "Fine Italian Silk", SellIn = 0, Quality = 80},
new Item {Name = "Fine Italian Silk", SellIn = -1, Quality = 80},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 15,
Quality = 20
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 10,
Quality = 49
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
// this Baked item does not work properly yet
new Item {Name = "Baked Chocolate Cake", SellIn = 3, Quality = 6}
};
var app = new GildedRose(Items);

View File

@ -14,11 +14,11 @@ namespace GildedRoseKata
{
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].Name != "Aged Cheese" && Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}
@ -30,7 +30,7 @@ namespace GildedRoseKata
{
Items[i].Quality = Items[i].Quality + 1;
if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name == "Backstage passes to a concert")
{
if (Items[i].SellIn < 11)
{
@ -51,20 +51,20 @@ namespace GildedRoseKata
}
}
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].SellIn = Items[i].SellIn - 1;
}
if (Items[i].SellIn < 0)
{
if (Items[i].Name != "Aged Brie")
if (Items[i].Name != "Aged Cheese")
{
if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
if (Items[i].Name != "Backstage passes to a concert")
{
if (Items[i].Quality > 0)
{
if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
if (Items[i].Name != "Fine Italian Silk")
{
Items[i].Quality = Items[i].Quality - 1;
}

View File

@ -13,31 +13,31 @@ namespace GildedRoseTests
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 = "Sports Memorabilia", SellIn = 10, Quality = 20},
new Item {Name = "Aged Cheese", SellIn = 2, Quality = 0},
new Item {Name = "Coffee Table Book", SellIn = 5, Quality = 7},
new Item {Name = "Fine Italian Silk", SellIn = 0, Quality = 80},
new Item {Name = "Fine Italian Silk", SellIn = -1, Quality = 80},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 15,
Quality = 20
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 10,
Quality = 49
},
new Item
{
Name = "Backstage passes to a TAFKAL80ETC concert",
Name = "Backstage passes to a concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
// this Baked item does not work properly yet
new Item {Name = "Baked Chocolate Cake", SellIn = 3, Quality = 6}
};
var app = new GildedRose(Items);

View File

@ -18,12 +18,12 @@ public:
{
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].name != "Aged Cheese"
&& items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}
@ -35,7 +35,7 @@ public:
{
items[i].quality = items[i].quality + 1;
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name == "Backstage passes to a concert")
{
if (items[i].sellIn < 11)
{
@ -56,20 +56,20 @@ public:
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].sellIn = items[i].sellIn - 1;
}
if (items[i].sellIn < 0)
{
if (items[i].name != "Aged Brie")
if (items[i].name != "Aged Cheese")
{
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert")
if (items[i].name != "Backstage passes to a concert")
{
if (items[i].quality > 0)
{
if (items[i].name != "Sulfuras, Hand of Ragnaros")
if (items[i].name != "Fine Italian Silk")
{
items[i].quality = items[i].quality - 1;
}

View File

@ -5,16 +5,16 @@ int main()
import std.stdio : writefln, writeln;
Item[] items = [
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 doesn't yet work properly
Item("Conjured Mana Cake", 3, 6),
Item("Sports Memorabilia", 10, 20),
Item("Aged Cheese", 2, 0),
Item("Coffee Table Book", 5, 7),
Item("Fine Italian Silk", 0, 80),
Item("Fine Italian Silk", -1, 80),
Item("Backstage passes to a concert", 15, 20),
Item("Backstage passes to a concert", 10, 49),
Item("Backstage passes to a concert", 5, 49),
// this Baked item doesn't yet work properly
Item("Baked Chocolate Cake", 3, 6),
];
auto app = new GildedRose(items);

View File

@ -13,12 +13,12 @@ unittest
void example()
{
Item[] items = [
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("Backstage passes to a TAFKAL80ETC concert", 15, 20),
Item("Conjured Mana Cake", 3, 6),
Item("Sports Memorabilia", 10, 20),
Item("Aged Cheese", 2, 0),
Item("Coffee Table Book", 5, 7),
Item("Fine Italian Silk", 0, 80),
Item("Backstage passes to a concert", 15, 20),
Item("Baked Chocolate Cake", 3, 6),
];
auto app = new GildedRose(items);
app.updateQuality;

View File

@ -4,16 +4,16 @@ main(List<String> 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)
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// this Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6)
];
GildedRose app = new GildedRose(items);

View File

@ -5,10 +5,10 @@ class GildedRose {
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].name != "Aged Cheese" &&
items[i].name != "Backstage passes to a concert") {
if (items[i].quality > 0) {
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
items[i].quality = items[i].quality - 1;
}
}
@ -16,7 +16,7 @@ class GildedRose {
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].name == "Backstage passes to a concert") {
if (items[i].sellIn < 11) {
if (items[i].quality < 50) {
items[i].quality = items[i].quality + 1;
@ -32,15 +32,15 @@ class GildedRose {
}
}
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
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].name != "Aged Cheese") {
if (items[i].name != "Backstage passes to a concert") {
if (items[i].quality > 0) {
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
if (items[i].name != "Fine Italian Silk") {
items[i].quality = items[i].quality - 1;
}
}

View File

@ -1,7 +1,7 @@
defmodule GildedRose do
# Example
# update_quality([%Item{name: "Backstage passes to a TAFKAL80ETC concert", sell_in: 9, quality: 1}])
# => [%Item{name: "Backstage passes to a TAFKAL80ETC concert", sell_in: 8, quality: 3}]
# update_quality([%Item{name: "Backstage passes to a concert", sell_in: 9, quality: 1}])
# => [%Item{name: "Backstage passes to a concert", sell_in: 8, quality: 3}]
def update_quality(items) do
Enum.map(items, &update_item/1)
@ -9,9 +9,9 @@ defmodule GildedRose do
def update_item(item) do
item = cond do
item.name != "Aged Brie" && item.name != "Backstage passes to a TAFKAL80ETC concert" ->
item.name != "Aged Cheese" && item.name != "Backstage passes to a concert" ->
if item.quality > 0 do
if item.name != "Sulfuras, Hand of Ragnaros" do
if item.name != "Fine Italian Silk" do
%{item | quality: item.quality - 1}
else
item
@ -24,7 +24,7 @@ defmodule GildedRose do
item.quality < 50 ->
item = %{item | quality: item.quality + 1}
cond do
item.name == "Backstage passes to a TAFKAL80ETC concert" ->
item.name == "Backstage passes to a concert" ->
item = cond do
item.sell_in < 11 ->
cond do
@ -49,20 +49,20 @@ defmodule GildedRose do
end
end
item = cond do
item.name != "Sulfuras, Hand of Ragnaros" ->
item.name != "Fine Italian Silk" ->
%{item | sell_in: item.sell_in - 1}
true -> item
end
cond do
item.sell_in < 0 ->
cond do
item.name != "Aged Brie" ->
item.name != "Aged Cheese" ->
cond do
item.name != "Backstage passes to a TAFKAL80ETC concert" ->
item.name != "Backstage passes to a concert" ->
cond do
item.quality > 0 ->
cond do
item.name != "Sulfuras, Hand of Ragnaros" ->
item.name != "Fine Italian Silk" ->
%{item | quality: item.quality - 1}
true -> item
end

View File

@ -12,9 +12,9 @@ update_quality : List Item -> List Item
update_quality items =
List.map
(\item ->
if item.name == "Aged Brie" || item.name == "Backstage passes to a TAFKAL80ETC concert" then
if item.name == "Aged Cheese" || item.name == "Backstage passes to a concert" then
if item.quality < 50 then
if item.name == "Backstage passes to a TAFKAL80ETC concert" then
if item.name == "Backstage passes to a concert" then
if item.sell_by < 0 then
{ item | sell_by = item.sell_by - 1, quality = 0 }
@ -33,7 +33,7 @@ update_quality items =
else
{ item | sell_by = item.sell_by }
else if item.name /= "Aged Brie" && item.name /= "Sulfuras, Hand of Ragnaros" then
else if item.name /= "Aged Cheese" && item.name /= "Fine Italian Silk" then
if item.sell_by < 0 && item.quality > 0 then
if item.quality >= 2 then
{ item | sell_by = item.sell_by - 1, quality = item.quality - 2 }

View File

@ -13,11 +13,11 @@ update_quality(Items) ->
-spec update_item(#item{}) -> #item{}.
update_item(Item = #item{name = Name}) ->
Item1 = if
Name /= "Aged Brie" andalso Name /= "Backstage passes to a TAFKAL80ETC concert" ->
Name /= "Aged Cheese" andalso Name /= "Backstage passes to a concert" ->
if
Item#item.quality > 0 ->
if
Name /= "Sulfuras, Hand of Ragnaros" ->
Name /= "Fine Italian Silk" ->
Item#item{quality = Item#item.quality - 1};
true ->
Item
@ -30,7 +30,7 @@ update_item(Item = #item{name = Name}) ->
Item#item.quality < 50 ->
Item2 = Item#item{quality = Item#item.quality + 1},
if
Name == "Backstage passes to a TAFKAL80ETC concert" ->
Name == "Backstage passes to a concert" ->
Item3 = if
Item2#item.sell_in < 11 ->
if
@ -55,20 +55,20 @@ update_item(Item = #item{name = Name}) ->
end
end,
Item4 = if
Name /= "Sulfuras, Hand of Ragnaros" ->
Name /= "Fine Italian Silk" ->
Item1#item{sell_in = Item1#item.sell_in - 1};
true -> Item1
end,
if
Item4#item.sell_in < 0 ->
if
Name /= "Aged Brie" ->
Name /= "Aged Cheese" ->
if
Name /= "Backstage passes to a TAFKAL80ETC concert" ->
Name /= "Backstage passes to a concert" ->
if
Item4#item.quality > 0 ->
if
Name /= "Sulfuras, Hand of Ragnaros" ->
Name /= "Fine Italian Silk" ->
Item4#item{quality = Item4#item.quality - 1};
true -> Item4
end;

View File

@ -5,15 +5,15 @@
-export([main/1]).
-define(ALL_ITEMS, [
#item{name = "+5 Dexterity Vest", sell_in = 10, quality = 20},
#item{name = "Aged Brie", sell_in = 2, quality = 0},
#item{name = "Elixir of the Mongoose", sell_in = 5, quality = 7},
#item{name = "Sulfuras, Hand of Ragnaros", sell_in = 0, quality = 80},
#item{name = "Sulfuras, Hand of Ragnaros", sell_in = -1, quality = 80},
#item{name = "Backstage passes to a TAFKAL80ETC concert", sell_in = 15, quality = 20},
#item{name = "Backstage passes to a TAFKAL80ETC concert", sell_in = 10, quality = 49},
#item{name = "Backstage passes to a TAFKAL80ETC concert", sell_in = 5, quality = 49},
#item{name = "Conjured Mana Cake", sell_in = 3, quality = 6}
#item{name = "Sports Memorabilia", sell_in = 10, quality = 20},
#item{name = "Aged Cheese", sell_in = 2, quality = 0},
#item{name = "Coffee Table Book", sell_in = 5, quality = 7},
#item{name = "Fine Italian Silk", sell_in = 0, quality = 80},
#item{name = "Fine Italian Silk", sell_in = -1, quality = 80},
#item{name = "Backstage passes to a concert", sell_in = 15, quality = 20},
#item{name = "Backstage passes to a concert", sell_in = 10, quality = 49},
#item{name = "Backstage passes to a concert", sell_in = 5, quality = 49},
#item{name = "Baked Chocolate Cake", sell_in = 3, quality = 6}
]).
main([Days]) ->

View File

@ -20,43 +20,43 @@ contains
subroutine init_item(it, name, sellIn, quality)
type(Item) :: it
character(len=*) :: name
integer :: sellIn
integer :: quality
character(len=*) :: name
integer :: sellIn
integer :: quality
it%name = trim(name)
it%sellIn = sellIn
it%quality = quality
end
end
function int2str( int_val )
implicit none
integer :: int_val
character( int(log10(real(max(abs(int_val),1)))) + 1 + &
(1-sign(1,int_val))/2 ) :: int2str
character(64) :: all_chars
character(64) :: all_chars
write(all_chars,*) int_val
int2str = trim( adjustl( all_chars ) )
end function
subroutine print_item(it)
type(Item) :: it
type(Item) :: it
write(*,*) trim(it%name), ', ', int2str(it%sellIn), ', ', int2str(it%quality)
end subroutine
end subroutine
subroutine update_quality(items, size)
type(Item), dimension(:) :: items
integer :: size
integer :: size
integer :: i
integer :: i
do i = 1, size
if (items(i)%name /= "Aged Brie" .and. items(i)%name /= "Backstage passes to a TAFKAL80ETC concert" ) then
if (items(i)%name /= "Aged Cheese" .and. items(i)%name /= "Backstage passes to a concert" ) then
if (items(i)%quality > 0) then
if (items(i)%name /= "Sulfuras, Hand of Ragnaros" ) then
if (items(i)%name /= "Fine Italian Silk" ) then
items(i)%quality = items(i)%quality - 1
endif
@ -68,8 +68,8 @@ contains
if (items(i)%quality < 50) then
items(i)%quality = items(i)%quality + 1
if ( items(i)%name =="Backstage passes to a TAFKAL80ETC concert") then
if ( items(i)%name =="Backstage passes to a concert") then
if (items(i)%sellIn < 11) then
@ -96,28 +96,28 @@ contains
endif
endif
if (items(i)%name /= "Sulfuras, Hand of Ragnaros") then
if (items(i)%name /= "Fine Italian Silk") then
items(i)%sellIn = items(i)%sellIn - 1
endif
if (items(i)%sellIn < 0) then
if (items(i)%name /= "Aged Brie" ) then
if (items(i)%name /= "Aged Cheese" ) then
if (items(i)%name /= "Backstage passes to a TAFKAL80ETC concert" ) then
if (items(i)%name /= "Backstage passes to a concert" ) then
if (items(i)%quality > 0 ) then
if (items(i)%name /= "Sulfuras, Hand of Ragnaros" )then
if (items(i)%name /= "Fine Italian Silk" )then
items(i)%quality = items(i)%quality - 1
endif
endif
else
items(i)%quality = items(i)%quality - items(i)%quality
@ -137,8 +137,8 @@ contains
end if
end do
end subroutine
end module

View File

@ -14,24 +14,24 @@ program GildedRose_text_test
last = 1
call init_item(items(last), "+5 Dexterity Vest", 10, 20)
call init_item(items(last), "Sports Memorabilia", 10, 20)
last=last+1
call init_item(items(last), "Aged Brie", 2, 0)
call init_item(items(last), "Aged Cheese", 2, 0)
last=last+1
call init_item(items(last), "Elixir of the Mongoose", 5, 7)
call init_item(items(last), "Coffee Table Book", 5, 7)
last=last+1
call init_item(items(last), "Sulfuras, Hand of Ragnaros", 0, 80)
call init_item(items(last), "Fine Italian Silk", 0, 80)
last=last+1
call init_item(items(last), "Sulfuras, Hand of Ragnaros", -1, 80)
call init_item(items(last), "Fine Italian Silk", -1, 80)
last=last+1
call init_item(items(last), "Backstage passes to a TAFKAL80ETC concert", 15, 20)
call init_item(items(last), "Backstage passes to a concert", 15, 20)
last=last+1
call init_item(items(last), "Backstage passes to a TAFKAL80ETC concert", 10, 49)
call init_item(items(last), "Backstage passes to a concert", 10, 49)
last=last+1
call init_item(items(last), "Backstage passes to a TAFKAL80ETC concert", 5, 49)
! this Conjured item doesn't yet work properly
call init_item(items(last), "Backstage passes to a concert", 5, 49)
! this Baked item doesn't yet work properly
last=last+1
call init_item(items(last), "Conjured Mana Cake", 3, 6)
call init_item(items(last), "Baked Chocolate Cake", 3, 6)
write(*,*) "OMGHAI!"
@ -46,7 +46,7 @@ program GildedRose_text_test
write(*,*) " "
call update_quality(items, last)
enddo
enddo
end program

View File

@ -1,373 +1,373 @@
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
Sports Memorabilia, 10, 20
Aged Cheese, 2, 0
Coffee Table Book, 5, 7
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 15, 20
Backstage passes to a concert, 10, 49
Backstage passes to a concert, 5, 49
Baked Chocolate 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
Sports Memorabilia, 9, 19
Aged Cheese, 1, 1
Coffee Table Book, 4, 6
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 14, 21
Backstage passes to a concert, 9, 50
Backstage passes to a concert, 4, 50
Baked Chocolate 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
Sports Memorabilia, 8, 18
Aged Cheese, 0, 2
Coffee Table Book, 3, 5
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 13, 22
Backstage passes to a concert, 8, 50
Backstage passes to a concert, 3, 50
Baked Chocolate 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
Sports Memorabilia, 7, 17
Aged Cheese, -1, 4
Coffee Table Book, 2, 4
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 12, 23
Backstage passes to a concert, 7, 50
Backstage passes to a concert, 2, 50
Baked Chocolate 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
Sports Memorabilia, 6, 16
Aged Cheese, -2, 6
Coffee Table Book, 1, 3
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 11, 24
Backstage passes to a concert, 6, 50
Backstage passes to a concert, 1, 50
Baked Chocolate 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
Sports Memorabilia, 5, 15
Aged Cheese, -3, 8
Coffee Table Book, 0, 2
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 10, 25
Backstage passes to a concert, 5, 50
Backstage passes to a concert, 0, 50
Baked Chocolate 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
Sports Memorabilia, 4, 14
Aged Cheese, -4, 10
Coffee Table Book, -1, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 9, 27
Backstage passes to a concert, 4, 50
Backstage passes to a concert, -1, 0
Baked Chocolate 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
Sports Memorabilia, 3, 13
Aged Cheese, -5, 12
Coffee Table Book, -2, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 8, 29
Backstage passes to a concert, 3, 50
Backstage passes to a concert, -2, 0
Baked Chocolate 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
Sports Memorabilia, 2, 12
Aged Cheese, -6, 14
Coffee Table Book, -3, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 7, 31
Backstage passes to a concert, 2, 50
Backstage passes to a concert, -3, 0
Baked Chocolate 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
Sports Memorabilia, 1, 11
Aged Cheese, -7, 16
Coffee Table Book, -4, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 6, 33
Backstage passes to a concert, 1, 50
Backstage passes to a concert, -4, 0
Baked Chocolate 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
Sports Memorabilia, 0, 10
Aged Cheese, -8, 18
Coffee Table Book, -5, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 5, 35
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Baked Chocolate 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
Sports Memorabilia, -1, 8
Aged Cheese, -9, 20
Coffee Table Book, -6, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 4, 38
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Baked Chocolate 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
Sports Memorabilia, -2, 6
Aged Cheese, -10, 22
Coffee Table Book, -7, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 3, 41
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Baked Chocolate 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
Sports Memorabilia, -3, 4
Aged Cheese, -11, 24
Coffee Table Book, -8, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 2, 44
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Baked Chocolate 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
Sports Memorabilia, -4, 2
Aged Cheese, -12, 26
Coffee Table Book, -9, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 1, 47
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Baked Chocolate 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
Sports Memorabilia, -5, 0
Aged Cheese, -13, 28
Coffee Table Book, -10, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Baked Chocolate 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
Sports Memorabilia, -6, 0
Aged Cheese, -14, 30
Coffee Table Book, -11, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Baked Chocolate 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
Sports Memorabilia, -7, 0
Aged Cheese, -15, 32
Coffee Table Book, -12, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Baked Chocolate 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
Sports Memorabilia, -8, 0
Aged Cheese, -16, 34
Coffee Table Book, -13, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Baked Chocolate 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
Sports Memorabilia, -9, 0
Aged Cheese, -17, 36
Coffee Table Book, -14, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Baked Chocolate 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
Sports Memorabilia, -10, 0
Aged Cheese, -18, 38
Coffee Table Book, -15, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Baked Chocolate 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
Sports Memorabilia, -11, 0
Aged Cheese, -19, 40
Coffee Table Book, -16, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Baked Chocolate 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
Sports Memorabilia, -12, 0
Aged Cheese, -20, 42
Coffee Table Book, -17, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Baked Chocolate 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
Sports Memorabilia, -13, 0
Aged Cheese, -21, 44
Coffee Table Book, -18, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Baked Chocolate 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
Sports Memorabilia, -14, 0
Aged Cheese, -22, 46
Coffee Table Book, -19, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Baked Chocolate 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
Sports Memorabilia, -15, 0
Aged Cheese, -23, 48
Coffee Table Book, -20, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Baked Chocolate 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
Sports Memorabilia, -16, 0
Aged Cheese, -24, 50
Coffee Table Book, -21, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Backstage passes to a concert, -21, 0
Baked Chocolate 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
Sports Memorabilia, -17, 0
Aged Cheese, -25, 50
Coffee Table Book, -22, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Backstage passes to a concert, -22, 0
Baked Chocolate 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
Sports Memorabilia, -18, 0
Aged Cheese, -26, 50
Coffee Table Book, -23, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Backstage passes to a concert, -23, 0
Baked Chocolate 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
Sports Memorabilia, -19, 0
Aged Cheese, -27, 50
Coffee Table Book, -24, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Backstage passes to a concert, -24, 0
Baked Chocolate 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
Sports Memorabilia, -20, 0
Aged Cheese, -28, 50
Coffee Table Book, -25, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Backstage passes to a concert, -25, 0
Baked Chocolate Cake, -27, 0

View File

@ -9,33 +9,33 @@ type GildedRose(items:IList<Item>) =
member this.UpdateQuality() =
for i = 0 to Items.Count - 1 do
if Items.[i].Name <> "Aged Brie" && Items.[i].Name <> "Backstage passes to a TAFKAL80ETC concert" then
if Items.[i].Name <> "Aged Cheese" && Items.[i].Name <> "Backstage passes to a concert" then
if Items.[i].Quality > 0 then
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
else
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name = "Backstage passes to a TAFKAL80ETC concert" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name = "Backstage passes to a concert" then
if Items.[i].SellIn < 11 then
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].SellIn < 6 then
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with SellIn = (Items.[i].SellIn - 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with SellIn = (Items.[i].SellIn - 1) }
if Items.[i].SellIn < 0 then
if Items.[i].Name <> "Aged Brie" then
if Items.[i].Name <> "Backstage passes to a TAFKAL80ETC concert" then
if Items.[i].Name <> "Aged Cheese" then
if Items.[i].Name <> "Backstage passes to a concert" then
if Items.[i].Quality > 0 then
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
else
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - Items.[i].Quality) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - Items.[i].Quality) }
else
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
()
@ -44,15 +44,15 @@ module Program =
let main argv =
printfn "OMGHAI!"
let Items = new List<Item>()
Items.Add({Name = "+5 Dexterity Vest"; SellIn = 10; Quality = 20})
Items.Add({Name = "Aged Brie"; SellIn = 2; Quality = 0})
Items.Add({Name = "Elixir of the Mongoose"; SellIn = 5; Quality = 7})
Items.Add({Name = "Sulfuras, Hand of Ragnaros"; SellIn = 0; Quality = 80})
Items.Add({Name = "Sulfuras, Hand of Ragnaros"; SellIn = -1; Quality = 80})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 15; Quality = 20})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 10; Quality = 49})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 5; Quality = 49})
Items.Add({Name = "Conjured Mana Cake"; SellIn = 3; Quality = 6})
Items.Add({Name = "Sports Memorabilia"; SellIn = 10; Quality = 20})
Items.Add({Name = "Aged Cheese"; SellIn = 2; Quality = 0})
Items.Add({Name = "Coffee Table Book"; SellIn = 5; Quality = 7})
Items.Add({Name = "Fine Italian Silk"; SellIn = 0; Quality = 80})
Items.Add({Name = "Fine Italian Silk"; SellIn = -1; Quality = 80})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 15; Quality = 20})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 10; Quality = 49})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 5; Quality = 49})
Items.Add({Name = "Baked Chocolate Cake"; SellIn = 3; Quality = 6})
let app = new GildedRose(Items)
for i = 0 to 30 do
@ -62,4 +62,4 @@ module Program =
printfn "%s, %d, %d" Items.[j].Name Items.[j].SellIn Items.[j].Quality
printfn ""
app.UpdateQuality()
0
0

View File

@ -9,48 +9,48 @@ type GildedRose(items:IList<Item>) as this =
member this.UpdateQuality() =
for i = 0 to Items.Count - 1 do
if Items.[i].Name <> "Aged Brie" && Items.[i].Name <> "Backstage passes to a TAFKAL80ETC concert" then
if Items.[i].Name <> "Aged Cheese" && Items.[i].Name <> "Backstage passes to a concert" then
if Items.[i].Quality > 0 then
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
else
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name = "Backstage passes to a TAFKAL80ETC concert" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name = "Backstage passes to a concert" then
if Items.[i].SellIn < 11 then
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].SellIn < 6 then
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with SellIn = (Items.[i].SellIn - 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with SellIn = (Items.[i].SellIn - 1) }
if Items.[i].SellIn < 0 then
if Items.[i].Name <> "Aged Brie" then
if Items.[i].Name <> "Backstage passes to a TAFKAL80ETC concert" then
if Items.[i].Name <> "Aged Cheese" then
if Items.[i].Name <> "Backstage passes to a concert" then
if Items.[i].Quality > 0 then
if Items.[i].Name <> "Sulfuras, Hand of Ragnaros" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
if Items.[i].Name <> "Fine Italian Silk" then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - 1) }
else
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - Items.[i].Quality) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality - Items.[i].Quality) }
else
if Items.[i].Quality < 50 then
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
Items.[i] <- { Items.[i] with Quality = (Items.[i].Quality + 1) }
()
[<EntryPoint>]
let main argv =
let main argv =
printfn "OMGHAI!"
let Items = new List<Item>()
Items.Add({Name = "+5 Dexterity Vest"; SellIn = 10; Quality = 20})
Items.Add({Name = "Aged Brie"; SellIn = 2; Quality = 0})
Items.Add({Name = "Elixir of the Mongoose"; SellIn = 5; Quality = 7})
Items.Add({Name = "Sulfuras, Hand of Ragnaros"; SellIn = 0; Quality = 80})
Items.Add({Name = "Sulfuras, Hand of Ragnaros"; SellIn = -1; Quality = 80})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 15; Quality = 20})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 10; Quality = 49})
Items.Add({Name = "Backstage passes to a TAFKAL80ETC concert"; SellIn = 5; Quality = 49})
Items.Add({Name = "Conjured Mana Cake"; SellIn = 3; Quality = 6})
Items.Add({Name = "Sports Memorabilia"; SellIn = 10; Quality = 20})
Items.Add({Name = "Aged Cheese"; SellIn = 2; Quality = 0})
Items.Add({Name = "Coffee Table Book"; SellIn = 5; Quality = 7})
Items.Add({Name = "Fine Italian Silk"; SellIn = 0; Quality = 80})
Items.Add({Name = "Fine Italian Silk"; SellIn = -1; Quality = 80})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 15; Quality = 20})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 10; Quality = 49})
Items.Add({Name = "Backstage passes to a concert"; SellIn = 5; Quality = 49})
Items.Add({Name = "Baked Chocolate Cake"; SellIn = 3; Quality = 6})
let app = new GildedRose(Items)
for i = 0 to 30 do
@ -60,4 +60,4 @@ let main argv =
printfn "%s, %d, %d" Items.[j].Name Items.[j].SellIn Items.[j].Quality
printfn ""
app.UpdateQuality()
0
0

View File

@ -8,16 +8,16 @@ type Item struct {
func UpdateQuality(items []*Item) {
for i := 0; i < len(items); i++ {
if items[i].Name != "Aged Brie" && items[i].Name != "Backstage passes to a TAFKAL80ETC concert" {
if items[i].Name != "Aged Cheese" && items[i].Name != "Backstage passes to a concert" {
if items[i].Quality > 0 {
if items[i].Name != "Sulfuras, Hand of Ragnaros" {
if items[i].Name != "Fine Italian Silk" {
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].Name == "Backstage passes to a concert" {
if items[i].SellIn < 11 {
if items[i].Quality < 50 {
items[i].Quality = items[i].Quality + 1
@ -32,15 +32,15 @@ func UpdateQuality(items []*Item) {
}
}
if items[i].Name != "Sulfuras, Hand of Ragnaros" {
if items[i].Name != "Fine Italian Silk" {
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].Name != "Aged Cheese" {
if items[i].Name != "Backstage passes to a concert" {
if items[i].Quality > 0 {
if items[i].Name != "Sulfuras, Hand of Ragnaros" {
if items[i].Name != "Fine Italian Silk" {
items[i].Quality = items[i].Quality - 1
}
}

View File

@ -12,15 +12,15 @@ func main() {
fmt.Println("OMGHAI!")
var items = []*gildedrose.Item{
{"+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}, // <-- :O
{"Sports Memorabilia", 10, 20},
{"Aged Cheese", 2, 0},
{"Coffee Table Book", 5, 7},
{"Fine Italian Silk", 0, 80},
{"Fine Italian Silk", -1, 80},
{"Backstage passes to a concert", 15, 20},
{"Backstage passes to a concert", 10, 49},
{"Backstage passes to a concert", 5, 49},
{"Baked Chocolate Cake", 3, 6}, // <-- :O
}
days := 2

View File

@ -15,12 +15,12 @@ updateQuality = map updateQualityItem
updateQualityItem (Item name sellIn quality) =
let
quality' =
if name /= "Aged Brie"
&& name /= "Backstage passes to a TAFKAL80ETC concert"
if name /= "Aged Cheese"
&& name /= "Backstage passes to a concert"
then
if quality > 0
then
if name /= "Sulfuras, Hand of Ragnaros"
if name /= "Fine Italian Silk"
then quality - 1
else quality
else quality
@ -28,7 +28,7 @@ updateQuality = map updateQualityItem
if quality < 50
then
quality + 1 +
(if name == "Backstage passes to a TAFKAL80ETC concert"
(if name == "Backstage passes to a concert"
then
if sellIn < 11
then
@ -46,19 +46,19 @@ updateQuality = map updateQualityItem
else quality
sellIn' =
if name /= "Sulfuras, Hand of Ragnaros"
if name /= "Fine Italian Silk"
then sellIn - 1
else sellIn
in
if sellIn' < 0
then
if name /= "Aged Brie"
if name /= "Aged Cheese"
then
if name /= "Backstage passes to a TAFKAL80ETC concert"
if name /= "Backstage passes to a concert"
then
if quality' > 0
then
if name /= "Sulfuras, Hand of Ragnaros"
if name /= "Fine Italian Silk"
then (Item name sellIn' (quality' - 1))
else (Item name sellIn' quality')
else (Item name sellIn' quality')

View File

@ -31,14 +31,14 @@ main = do
initialInventory :: GildedRose
initialInventory =
[ 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
[ Item "Sports Memorabilia" 10 20
, Item "Aged Cheese" 2 0
, Item "Coffee Table Book" 5 7
, Item "Fine Italian Silk" 0 80
, Item "Fine Italian Silk" (-1) 80
, Item "Backstage passes to a concert" 15 20
, Item "Backstage passes to a concert" 10 49
, Item "Backstage passes to a concert" 5 49
-- this Baked item does not work properly yet
, Item "Baked Chocolate Cake" 3 6
]

View File

@ -3,9 +3,9 @@ def update_quality:
foreach .[] as $item (
null;
$item |
if .name != "Aged Brie" and .name != "Backstage passes to a TAFKAL80ETC concert" then
if .name != "Aged Cheese" and .name != "Backstage passes to a concert" then
if .quality > 0 then
if .name != "Sulfuras, Hand of Ragnaros" then
if .name != "Fine Italian Silk" then
.quality = .quality - 1
else . end
else . end
@ -13,7 +13,7 @@ def update_quality:
if .quality < 50 then
.quality = .quality + 1
|
if .name == "Backstage passes to a TAFKAL80ETC concert" then
if .name == "Backstage passes to a concert" then
if .sell_in < 11 then
if .quality < 50 then
.quality = .quality + 1
@ -29,15 +29,15 @@ def update_quality:
else . end
end
|
if .name != "Sulfuras, Hand of Ragnaros" then
if .name != "Fine Italian Silk" then
.sell_in = .sell_in - 1
else . end
|
if .sell_in < 0 then
if .name != "Aged Brie" then
if .name != "Backstage passes to a TAFKAL80ETC concert" then
if .name != "Aged Cheese" then
if .name != "Backstage passes to a concert" then
if .quality > 0 then
if .name != "Sulfuras, Hand of Ragnaros" then
if .name != "Fine Italian Silk" then
.quality = .quality - 1
else . end
else . end

View File

@ -1,15 +1,15 @@
"OMGHAI!",
(
[
{ name: "+5 Dexterity Vest", sell_in: 10, quality: 20 },
{ name: "Aged Brie", sell_in: 2, quality: 0 },
{ name: "Elixir of the Mongoose", sell_in: 5, quality: 7 },
{ name: "Sulfuras, Hand of Ragnaros", sell_in: 0, quality: 80 },
{ name: "Sulfuras, Hand of Ragnaros", sell_in: -1, quality: 80 },
{ name: "Backstage passes to a TAFKAL80ETC concert", sell_in: 15, quality: 20 },
{ name: "Backstage passes to a TAFKAL80ETC concert", sell_in: 10, quality: 49 },
{ name: "Backstage passes to a TAFKAL80ETC concert", sell_in: 5, quality: 49 },
{ name: "Conjured Mana Cake", sell_in: 3, quality: 6} # <-- :O
{ name: "Sports Memorabilia", sell_in: 10, quality: 20 },
{ name: "Aged Cheese", sell_in: 2, quality: 0 },
{ name: "Coffee Table Book", sell_in: 5, quality: 7 },
{ name: "Fine Italian Silk", sell_in: 0, quality: 80 },
{ name: "Fine Italian Silk", sell_in: -1, quality: 80 },
{ name: "Backstage passes to a concert", sell_in: 15, quality: 20 },
{ name: "Backstage passes to a concert", sell_in: 10, quality: 49 },
{ name: "Backstage passes to a concert", sell_in: 5, quality: 49 },
{ name: "Baked Chocolate Cake", sell_in: 3, quality: 6} # <-- :O
] |
{ items: ., day: 0 } |
recurse(.day += 1 | .items = (.items | update_quality); .day < ($ARGS.named.days // 2 | tonumber)) |

View File

@ -2,17 +2,17 @@
const { Shop, Item } = require("../src/gilded_rose");
const 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),
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// This Conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6),
// This Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6),
];
const days = Number(process.argv[2]) || 2;

View File

@ -12,16 +12,16 @@ class Shop {
}
updateQuality() {
for (var 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].name != 'Aged Cheese' && this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name == 'Backstage passes to a concert') {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1;
@ -35,14 +35,14 @@ class Shop {
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name != 'Aged Cheese') {
if (this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
this.items[i].quality = this.items[i].quality - 1;
}
}

View File

@ -12,16 +12,16 @@ class Shop {
}
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].name != 'Aged Cheese' && this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name == 'Backstage passes to a concert') {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1;
@ -35,14 +35,14 @@ class Shop {
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name != 'Aged Cheese') {
if (this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
this.items[i].quality = this.items[i].quality - 1;
}
}

View File

@ -2,17 +2,17 @@
const { Shop, Item } = require("../src/gilded_rose");
const 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),
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// This Conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6),
// This Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6),
];
const days = Number(process.argv[2]) || 2;

View File

@ -12,16 +12,16 @@ class Shop {
}
updateQuality() {
for (var 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].name != 'Aged Cheese' && this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name == 'Backstage passes to a concert') {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1;
@ -35,14 +35,14 @@ class Shop {
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
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].name != 'Aged Cheese') {
if (this.items[i].name != 'Backstage passes to a concert') {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != 'Fine Italian Silk') {
this.items[i].quality = this.items[i].quality - 1;
}
}

View File

@ -2,17 +2,17 @@
const { Shop, Item } = require("../src/gilded_rose");
const 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),
new Item("Sports Memorabilia", 10, 20),
new Item("Aged Cheese", 2, 0),
new Item("Coffee Table Book", 5, 7),
new Item("Fine Italian Silk", 0, 80),
new Item("Fine Italian Silk", -1, 80),
new Item("Backstage passes to a concert", 15, 20),
new Item("Backstage passes to a concert", 10, 49),
new Item("Backstage passes to a concert", 5, 49),
// This Conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6),
// This Baked item does not work properly yet
new Item("Baked Chocolate Cake", 3, 6),
];
const days = Number(process.argv[2]) || 2;

View File

@ -14,16 +14,16 @@ end
function update_quality!(gr::GildedRose)
for item in gr.items
if item.name != "Aged Brie" && item.name != "Backstage passes to a TAFKAL80ETC concert"
if item.name != "Aged Cheese" && item.name != "Backstage passes to a concert"
if item.quality > 0
if item.name != "Sulfuras, Hand of Ragnaros"
if item.name != "Fine Italian Silk"
item.quality = item.quality - 1
end
end
else
if item.quality < 50
item.quality = item.quality + 1
if item.name == "Backstage passes to a TAFKAL80ETC concert"
if item.name == "Backstage passes to a concert"
if item.sellin < 11
if item.quality < 50
item.quality = item.quality + 1
@ -37,14 +37,14 @@ function update_quality!(gr::GildedRose)
end
end
end
if item.name != "Sulfuras, Hand of Ragnaros"
if item.name != "Fine Italian Silk"
item.sellin = item.sellin - 1
end
if item.sellin < 0
if item.name != "Aged Brie"
if item.name != "Backstage passes to a TAFKAL80ETC concert"
if item.name != "Aged Cheese"
if item.name != "Backstage passes to a concert"
if item.quality > 0
if item.name != "Sulfuras, Hand of Ragnaros"
if item.name != "Fine Italian Silk"
item.quality = item.quality - 1
end
end
@ -68,15 +68,15 @@ end
function main(; days::Int64=2)
println("OMGHAI!")
items = [
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),
Item("Conjured Mana Cake", 3, 6),
Item("Sports Memorabilia", 10, 20),
Item("Aged Cheese", 2, 0),
Item("Coffee Table Book", 5, 7),
Item("Fine Italian Silk", 0, 80),
Item("Fine Italian Silk", -1, 80),
Item("Backstage passes to a concert", 15, 20),
Item("Backstage passes to a concert", 10, 49),
Item("Backstage passes to a concert", 5, 49),
Item("Baked Chocolate Cake", 3, 6),
]
for day in 1:days
println("-------- day $day --------")

View File

@ -15,16 +15,16 @@
;; 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
;; "Aged Cheese" 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
;; "Fine Italian Silk", being a luxury item, never has to be sold or decreases in Quality
;; "Backstage passes", like Aged Cheese, 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
;; We have recently signed a supplier of Baked items. This requires an update to our system:
;; "Baked" 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
@ -33,7 +33,7 @@
;; 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
;; above 50, however "Fine Italian Silk" is a luxury item and as such its
;; Quality is 80 and it never alters.
;; https://github.com/emilybache/GildedRose-Refactoring-Kata
@ -55,19 +55,19 @@
(defun update-item (item)
(let* ((item (if (and (not (string:equal (item-name item)
"Aged Brie"))
"Aged Cheese"))
(not (string:equal (item-name item)
"Backstage passes to a TAFKAL80ETC concert")))
"Backstage passes to a concert")))
(if (> (item-quality item) 0)
(if (not (string:equal (item-name item)
"Sulfuras, Hand of Ragnaros"))
"Fine Italian Silk"))
(set-item-quality item (- (item-quality item) 1))
item)
item)
(if (< (item-quality item) 50)
(set-item-quality item (+ (item-quality item) 1))
(if (string:equal (item-name item)
"Backstage passes to a TAFKAL80ETC concert")
"Backstage passes to a concert")
(if (< (item-sellin item) 11)
(if (< (item-quality item) 50)
(set-item-quality item (+ (item-quality item) 1))
@ -79,17 +79,17 @@
item)
item)))))
(item (if (not (string:equal (item-name item)
"Sulfuras, Hand of Ragnaros"))
"Fine Italian Silk"))
(set-item-sellin item (- (item-sellin item) 1))
item)))
(if (< (item-sellin item) 0)
(if (not (string:equal (item-name item)
"Aged Brie"))
"Aged Cheese"))
(if (not (string:equal (item-name item)
"Backstage passes to a TAFKAL80ETC concert"))
"Backstage passes to a concert"))
(if (> (item-quality item) 0)
(if (not (string:equal (item-name item)
"Sulfuras, Hand of Ragnaros"))
"Fine Italian Silk"))
(set-item-quality item (- (item-quality item) 1))
item)
item)
@ -114,16 +114,16 @@
(defun run-gilded-rose (days)
(io:format "OMGHAI!~n")
(let ((items (list (make-item name "+5 Dexterity Vest" sellin 10 quality 20)
(make-item name "Aged Brie" sellin 2 quality 0)
(make-item name "Elixir of the Mongoose" sellin 5 quality 7)
(make-item name "Sulfuras, Hand of Ragnaros" sellin 0 quality 80)
(make-item name "Sulfuras, Hand of Ragnaros" sellin -1 quality 80)
(make-item name "Backstage passes to a TAFKAL80ETC concert" sellin 15 quality 20)
(make-item name "Backstage passes to a TAFKAL80ETC concert" sellin 10 quality 49)
(make-item name "Backstage passes to a TAFKAL80ETC concert" sellin 5 quality 49)
;; this conjured item does not work properly yet
(make-item name "Conjured Mana Cake" sellin 3 quality 6))))
(let ((items (list (make-item name "Sports Memorabilia" sellin 10 quality 20)
(make-item name "Aged Cheese" sellin 2 quality 0)
(make-item name "Coffee Table Book" sellin 5 quality 7)
(make-item name "Fine Italian Silk" sellin 0 quality 80)
(make-item name "Fine Italian Silk" sellin -1 quality 80)
(make-item name "Backstage passes to a concert" sellin 15 quality 20)
(make-item name "Backstage passes to a concert" sellin 10 quality 49)
(make-item name "Backstage passes to a concert" sellin 5 quality 49)
;; this Baked item does not work properly yet
(make-item name "Baked Chocolate Cake" sellin 3 quality 6))))
(lists:foldl (lambda (day gr)
(print-day day (gilded-rose-items gr))

View File

@ -61,12 +61,12 @@ var I: Word;
begin
for I := 0 to Items.Length-1 do
begin
if (Items.Elements^[I].Name <> 'Aged Brie') and
(Items.Elements^[I].Name <> 'Backstage passes to a TAFKAL80ETC concert') then
if (Items.Elements^[I].Name <> 'Aged Cheese') and
(Items.Elements^[I].Name <> 'Backstage passes to a concert') then
begin
if Items.Elements^[I].Quality > 0 then
begin
if Items.Elements^[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items.Elements^[I].Name <> 'Fine Italian Silk' then
begin
Items.Elements^[I].Quality := Items.Elements^[I].Quality - 1;
end;
@ -78,7 +78,7 @@ begin
begin
Items.Elements^[I].Quality := Items.Elements^[I].Quality + 1;
if Items.Elements^[I].Name = 'Backstage passes to a TAFKAL80ETC concert' then
if Items.Elements^[I].Name = 'Backstage passes to a concert' then
begin
if Items.Elements^[I].SellIn < 11 then
begin
@ -99,20 +99,20 @@ begin
end;
end;
if Items.Elements^[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items.Elements^[I].Name <> 'Fine Italian Silk' then
begin
Items.Elements^[I].SellIn := Items.Elements^[I].SellIn - 1;
end;
if Items.Elements^[I].SellIn < 0 then
begin
if Items.Elements^[I].Name <> 'Aged Brie' then
if Items.Elements^[I].Name <> 'Aged Cheese' then
begin
if Items.Elements^[I].Name <> 'Backstage passes to a TAFKAL80ETC concert' then
if Items.Elements^[I].Name <> 'Backstage passes to a concert' then
begin
if Items.Elements^[I].Quality > 0 then
begin
if Items.Elements^[I].Name <> 'Sulfuras, Hand of Ragnaros' then
if Items.Elements^[I].Name <> 'Fine Italian Silk' then
begin
Items.Elements^[I].Quality := Items.Elements^[I].Quality - 1;
end;

View File

@ -14,24 +14,24 @@ begin
ResizeList(Items, 9);
Last := 0;
InitItem(Items.Elements^[Last], '+5 Dexterity Vest', 10, 20);
InitItem(Items.Elements^[Last], 'Sports Memorabilia', 10, 20);
Inc(Last);
InitItem(Items.Elements^[Last], 'Aged Brie', 2, 0);
InitItem(Items.Elements^[Last], 'Aged Cheese', 2, 0);
Inc(Last);
InitItem(Items.Elements^[Last], 'Elixir of the Mongoose', 5, 7);
InitItem(Items.Elements^[Last], 'Coffee Table Book', 5, 7);
Inc(Last);
InitItem(Items.Elements^[Last], 'Sulfuras, Hand of Ragnaros', 0, 80);
InitItem(Items.Elements^[Last], 'Fine Italian Silk', 0, 80);
Inc(Last);
InitItem(Items.Elements^[Last], 'Sulfuras, Hand of Ragnaros', -1, 80);
InitItem(Items.Elements^[Last], 'Fine Italian Silk', -1, 80);
Inc(Last);
InitItem(Items.Elements^[Last], 'Backstage passes to a TAFKAL80ETC concert', 15, 20);
InitItem(Items.Elements^[Last], 'Backstage passes to a concert', 15, 20);
Inc(Last);
InitItem(Items.Elements^[Last], 'Backstage passes to a TAFKAL80ETC concert', 10, 49);
InitItem(Items.Elements^[Last], 'Backstage passes to a concert', 10, 49);
Inc(Last);
InitItem(Items.Elements^[Last], 'Backstage passes to a TAFKAL80ETC concert', 5, 49);
InitItem(Items.Elements^[Last], 'Backstage passes to a concert', 5, 49);
Inc(Last);
{ this Conjured item doesn't yet work properly }
InitItem(Items.Elements^[Last], 'Conjured Mana Cake', 3, 6);
{ this Baked item doesn't yet work properly }
InitItem(Items.Elements^[Last], 'Baked Chocolate Cake', 3, 6);
Inc(Last);
Items.Length := Last;

View File

@ -11,11 +11,11 @@ sub new {
sub update_quality {
my $self = shift;
for my $item ( @{ $self->{items} } ) {
if ( $item->{name} ne 'Aged Brie'
&& $item->{name} ne 'Backstage passes to a TAFKAL80ETC concert' )
if ( $item->{name} ne 'Aged Cheese'
&& $item->{name} ne 'Backstage passes to a concert' )
{
if ( $item->{quality} > 0 ) {
if ( $item->{name} ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item->{name} ne 'Fine Italian Silk' ) {
$item->{quality} = $item->{quality} - 1;
}
}
@ -25,7 +25,7 @@ sub update_quality {
$item->{quality} = $item->{quality} + 1;
if ( $item->{name} eq
'Backstage passes to a TAFKAL80ETC concert' )
'Backstage passes to a concert' )
{
if ( $item->{sell_in} < 11 ) {
if ( $item->{quality} < 50 ) {
@ -42,17 +42,17 @@ sub update_quality {
}
}
if ( $item->{name} ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item->{name} ne 'Fine Italian Silk' ) {
$item->{sell_in} = $item->{sell_in} - 1;
}
if ( $item->{sell_in} < 0 ) {
if ( $item->{name} ne 'Aged Brie' ) {
if ( $item->{name} ne 'Aged Cheese' ) {
if ( $item->{name} ne
'Backstage passes to a TAFKAL80ETC concert' )
'Backstage passes to a concert' )
{
if ( $item->{quality} > 0 ) {
if ( $item->{name} ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item->{name} ne 'Fine Italian Silk' ) {
$item->{quality} = $item->{quality} - 1;
}
}

View File

@ -9,47 +9,47 @@ use Item;
print 'OMGHAI!', "\n";
my $items = [
Item->new(
name => '+5 Dexterity Vest',
name => 'Sports Memorabilia',
sell_in => 10,
quality => 20
),
Item->new(
name => 'Aged Brie',
name => 'Aged Cheese',
sell_in => 2,
quality => 0
),
Item->new(
name => 'Elixir of the Mongoose',
name => 'Coffee Table Book',
sell_in => 5,
quality => 7
),
Item->new(
name => 'Sulfuras, Hand of Ragnaros',
name => 'Fine Italian Silk',
sell_in => 0,
quality => 80
),
Item->new(
name => 'Sulfuras, Hand of Ragnaros',
name => 'Fine Italian Silk',
sell_in => -1,
quality => 80
),
Item->new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 15,
quality => 20
),
Item->new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 10,
quality => 49
),
Item->new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 5,
quality => 49
),
Item->new( # This Conjured item does not work properly yet
name => 'Conjured Mana Cake',
Item->new( # This Baked item does not work properly yet
name => 'Baked Chocolate Cake',
sell_in => 3,
quality => 6
),

View File

@ -7,9 +7,9 @@ class GildedRose {
method update_quality {
for @!items -> $item {
if ($item.name ne 'Aged Brie' && $item.name ne 'Backstage passes to a TAFKAL80ETC concert') {
if ($item.name ne 'Aged Cheese' && $item.name ne 'Backstage passes to a concert') {
if ( $item.quality > 0 ) {
if ( $item.name ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item.name ne 'Fine Italian Silk' ) {
$item.quality = $item.quality - 1;
}
}
@ -18,7 +18,7 @@ class GildedRose {
if ( $item.quality < 50 ) {
$item.quality = $item.quality + 1;
if ( $item.name eq 'Backstage passes to a TAFKAL80ETC concert' )
if ( $item.name eq 'Backstage passes to a concert' )
{
if ( $item.sell_in < 11 ) {
if ( $item.quality < 50 ) {
@ -35,17 +35,17 @@ class GildedRose {
}
}
if ( $item.name ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item.name ne 'Fine Italian Silk' ) {
$item.sell_in = $item.sell_in - 1;
}
if ( $item.sell_in < 0 ) {
if ( $item.name ne 'Aged Brie' ) {
if ( $item.name ne 'Aged Cheese' ) {
if ( $item.name ne
'Backstage passes to a TAFKAL80ETC concert' )
'Backstage passes to a concert' )
{
if ( $item.quality > 0 ) {
if ( $item.name ne 'Sulfuras, Hand of Ragnaros' ) {
if ( $item.name ne 'Fine Italian Silk' ) {
$item.quality = $item.quality - 1;
}
}

View File

@ -10,47 +10,47 @@ use Item;
print 'OMGHAI!', "\n";
my @items = (
Item.new(
name => '+5 Dexterity Vest',
name => 'Sports Memorabilia',
sell_in => 10,
quality => 20
),
Item.new(
name => 'Aged Brie',
name => 'Aged Cheese',
sell_in => 2,
quality => 0
),
Item.new(
name => 'Elixir of the Mongoose',
name => 'Coffee Table Book',
sell_in => 5,
quality => 7
),
Item.new(
name => 'Sulfuras, Hand of Ragnaros',
name => 'Fine Italian Silk',
sell_in => 0,
quality => 80
),
Item.new(
name => 'Sulfuras, Hand of Ragnaros',
name => 'Fine Italian Silk',
sell_in => -1,
quality => 80
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 15,
quality => 20
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 10,
quality => 49
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
name => 'Backstage passes to a concert',
sell_in => 5,
quality => 49
),
Item.new( # This Conjured item does not work properly yet
name => 'Conjured Mana Cake',
Item.new( # This Baked item does not work properly yet
name => 'Baked Chocolate Cake',
sell_in => 3,
quality => 6
),

View File

@ -10,16 +10,16 @@ use GildedRose\Item;
echo 'OMGHAI!' . PHP_EOL;
$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),
new Item('Sports Memorabilia', 10, 20),
new Item('Aged Cheese', 2, 0),
new Item('Coffee Table Book', 5, 7),
new Item('Fine Italian Silk', 0, 80),
new Item('Fine Italian Silk', -1, 80),
new Item('Backstage passes to a concert', 15, 20),
new Item('Backstage passes to a concert', 10, 49),
new Item('Backstage passes to a concert', 5, 49),
// this Baked item does not work properly yet
new Item('Baked Chocolate Cake', 3, 6),
];
$app = new GildedRose($items);

View File

@ -17,16 +17,16 @@ final class GildedRose
public function updateQuality(): void
{
foreach ($this->items as $item) {
if ($item->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') {
if ($item->name != 'Aged Cheese' and $item->name != 'Backstage passes to a concert') {
if ($item->quality > 0) {
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
if ($item->name != 'Fine Italian Silk') {
$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->name == 'Backstage passes to a concert') {
if ($item->sellIn < 11) {
if ($item->quality < 50) {
$item->quality = $item->quality + 1;
@ -41,15 +41,15 @@ final class GildedRose
}
}
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
if ($item->name != 'Fine Italian Silk') {
$item->sellIn = $item->sellIn - 1;
}
if ($item->sellIn < 0) {
if ($item->name != 'Aged Brie') {
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
if ($item->name != 'Aged Cheese') {
if ($item->name != 'Backstage passes to a concert') {
if ($item->quality > 0) {
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
if ($item->name != 'Fine Italian Silk') {
$item->quality = $item->quality - 1;
}
}

View File

@ -1,373 +1,373 @@
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
Sports Memorabilia, 10, 20
Aged Cheese, 2, 0
Coffee Table Book, 5, 7
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 15, 20
Backstage passes to a concert, 10, 49
Backstage passes to a concert, 5, 49
Baked Chocolate 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
Sports Memorabilia, 9, 19
Aged Cheese, 1, 1
Coffee Table Book, 4, 6
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 14, 21
Backstage passes to a concert, 9, 50
Backstage passes to a concert, 4, 50
Baked Chocolate 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
Sports Memorabilia, 8, 18
Aged Cheese, 0, 2
Coffee Table Book, 3, 5
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 13, 22
Backstage passes to a concert, 8, 50
Backstage passes to a concert, 3, 50
Baked Chocolate 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
Sports Memorabilia, 7, 17
Aged Cheese, -1, 4
Coffee Table Book, 2, 4
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 12, 23
Backstage passes to a concert, 7, 50
Backstage passes to a concert, 2, 50
Baked Chocolate 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
Sports Memorabilia, 6, 16
Aged Cheese, -2, 6
Coffee Table Book, 1, 3
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 11, 24
Backstage passes to a concert, 6, 50
Backstage passes to a concert, 1, 50
Baked Chocolate 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
Sports Memorabilia, 5, 15
Aged Cheese, -3, 8
Coffee Table Book, 0, 2
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 10, 25
Backstage passes to a concert, 5, 50
Backstage passes to a concert, 0, 50
Baked Chocolate 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
Sports Memorabilia, 4, 14
Aged Cheese, -4, 10
Coffee Table Book, -1, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 9, 27
Backstage passes to a concert, 4, 50
Backstage passes to a concert, -1, 0
Baked Chocolate 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
Sports Memorabilia, 3, 13
Aged Cheese, -5, 12
Coffee Table Book, -2, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 8, 29
Backstage passes to a concert, 3, 50
Backstage passes to a concert, -2, 0
Baked Chocolate 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
Sports Memorabilia, 2, 12
Aged Cheese, -6, 14
Coffee Table Book, -3, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 7, 31
Backstage passes to a concert, 2, 50
Backstage passes to a concert, -3, 0
Baked Chocolate 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
Sports Memorabilia, 1, 11
Aged Cheese, -7, 16
Coffee Table Book, -4, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 6, 33
Backstage passes to a concert, 1, 50
Backstage passes to a concert, -4, 0
Baked Chocolate 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
Sports Memorabilia, 0, 10
Aged Cheese, -8, 18
Coffee Table Book, -5, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 5, 35
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Baked Chocolate 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
Sports Memorabilia, -1, 8
Aged Cheese, -9, 20
Coffee Table Book, -6, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 4, 38
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Baked Chocolate 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
Sports Memorabilia, -2, 6
Aged Cheese, -10, 22
Coffee Table Book, -7, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 3, 41
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Baked Chocolate 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
Sports Memorabilia, -3, 4
Aged Cheese, -11, 24
Coffee Table Book, -8, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 2, 44
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Baked Chocolate 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
Sports Memorabilia, -4, 2
Aged Cheese, -12, 26
Coffee Table Book, -9, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 1, 47
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Baked Chocolate 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
Sports Memorabilia, -5, 0
Aged Cheese, -13, 28
Coffee Table Book, -10, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, 0, 50
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Baked Chocolate 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
Sports Memorabilia, -6, 0
Aged Cheese, -14, 30
Coffee Table Book, -11, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -1, 0
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Baked Chocolate 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
Sports Memorabilia, -7, 0
Aged Cheese, -15, 32
Coffee Table Book, -12, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -2, 0
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Baked Chocolate 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
Sports Memorabilia, -8, 0
Aged Cheese, -16, 34
Coffee Table Book, -13, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -3, 0
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Baked Chocolate 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
Sports Memorabilia, -9, 0
Aged Cheese, -17, 36
Coffee Table Book, -14, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -4, 0
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Baked Chocolate 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
Sports Memorabilia, -10, 0
Aged Cheese, -18, 38
Coffee Table Book, -15, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -5, 0
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Baked Chocolate 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
Sports Memorabilia, -11, 0
Aged Cheese, -19, 40
Coffee Table Book, -16, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -6, 0
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Baked Chocolate 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
Sports Memorabilia, -12, 0
Aged Cheese, -20, 42
Coffee Table Book, -17, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -7, 0
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Baked Chocolate 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
Sports Memorabilia, -13, 0
Aged Cheese, -21, 44
Coffee Table Book, -18, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -8, 0
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Baked Chocolate 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
Sports Memorabilia, -14, 0
Aged Cheese, -22, 46
Coffee Table Book, -19, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -9, 0
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Baked Chocolate 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
Sports Memorabilia, -15, 0
Aged Cheese, -23, 48
Coffee Table Book, -20, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -10, 0
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Baked Chocolate 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
Sports Memorabilia, -16, 0
Aged Cheese, -24, 50
Coffee Table Book, -21, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -11, 0
Backstage passes to a concert, -16, 0
Backstage passes to a concert, -21, 0
Baked Chocolate 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
Sports Memorabilia, -17, 0
Aged Cheese, -25, 50
Coffee Table Book, -22, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -12, 0
Backstage passes to a concert, -17, 0
Backstage passes to a concert, -22, 0
Baked Chocolate 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
Sports Memorabilia, -18, 0
Aged Cheese, -26, 50
Coffee Table Book, -23, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -13, 0
Backstage passes to a concert, -18, 0
Backstage passes to a concert, -23, 0
Baked Chocolate 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
Sports Memorabilia, -19, 0
Aged Cheese, -27, 50
Coffee Table Book, -24, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -14, 0
Backstage passes to a concert, -19, 0
Backstage passes to a concert, -24, 0
Baked Chocolate 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
Sports Memorabilia, -20, 0
Aged Cheese, -28, 50
Coffee Table Book, -25, 0
Fine Italian Silk, 0, 80
Fine Italian Silk, -1, 80
Backstage passes to a concert, -15, 0
Backstage passes to a concert, -20, 0
Backstage passes to a concert, -25, 0
Baked Chocolate Cake, -27, 0

View File

@ -8,9 +8,9 @@ note left
An item has a name, a sell in value and a quality value
end note
if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (yes)
if (not "Aged Cheese" and not "Backstage passes to a concert") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif
@ -19,7 +19,7 @@ if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (y
else (no)
if (quality < 50) then (yes)
:increase quality with 1;
if ("Backstage passes to a TAFKAL80ETC concert") then (yes)
if ("Backstage passes to a concert") then (yes)
if (sell in < 11) then (yes)
if (quality < 50) then (yes)
:increase quality with 1;
@ -40,16 +40,16 @@ else (no)
endif
endif
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower sell in with 1;
else (no)
endif
if (sell in < 0) then (yes)
if (not "Aged Brie") then (yes)
if (not "Backstage passes to a TAFKAL80ETC concert") then (yes)
if (not "Aged Cheese") then (yes)
if (not "Backstage passes to a concert") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif

View File

@ -4,7 +4,7 @@ skinparam backgroundColor transparent
start
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
:lower quality with 1;
else (no)
@ -16,7 +16,7 @@ endif
:lower sell in with 1;
if (sell in < 0) then (yes)
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
:lower quality with 1;
else (no)

View File

@ -4,7 +4,7 @@ skinparam backgroundColor transparent
start
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
:lower quality with 1;
else (no)
@ -19,7 +19,7 @@ endif
:lower sell in with 1;
if (sell in < 0) then (yes)
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
:lower quality with 1;
else (no)

View File

@ -4,9 +4,9 @@ skinparam backgroundColor transparent
start
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif
@ -19,15 +19,15 @@ else (no)
endif
endif
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower sell in with 1;
else (no)
endif
if (sell in < 0) then (yes)
if (not "Aged Brie") then (yes)
if (not "Aged Cheese") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif

View File

@ -4,9 +4,9 @@ skinparam backgroundColor transparent
start
if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (yes)
if (not "Aged Cheese" and not "Backstage passes to a concert") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif
@ -15,7 +15,7 @@ if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (y
else (no)
if (quality < 50) then (yes)
:increase quality with 1;
if ("Backstage passes to a TAFKAL80ETC concert") then (yes)
if ("Backstage passes to a concert") then (yes)
if (sell in < 11) then (yes)
if (quality < 50) then (yes)
:increase quality with 1;
@ -36,16 +36,16 @@ else (no)
endif
endif
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower sell in with 1;
else (no)
endif
if (sell in < 0) then (yes)
if (not "Aged Brie") then (yes)
if (not "Backstage passes to a TAFKAL80ETC concert") then (yes)
if (not "Aged Cheese") then (yes)
if (not "Backstage passes to a concert") then (yes)
if (quality > 0) then (yes)
if (not "Sulfuras, Hand of Ragnaros") then (yes)
if (not "Fine Italian Silk") then (yes)
:lower quality with 1;
else (no)
endif

View File

@ -22,7 +22,7 @@ If you get this message```LINE 1: CREATE OR REPLACE PROCEDURE public.update_qual
# Run
In shell:
- connect to CLI: ```psql -d kata```
- add item: ```CALL new_item('+5 Dexterity Vest', 10, 20);```
- add item: ```CALL new_item('Sports Memorabilia', 10, 20);```
- check item state: ```SELECT * FROM item;```
- execute item update: ```CALL update_quality();```
- check item state: ```SELECT * FROM item;```

View File

@ -40,16 +40,16 @@ DECLARE
BEGIN
-- given
TRUNCATE TABLE item;
CALL new_item('+5 Dexterity Vest', 10, 20);
CALL new_item('Aged Brie', 2, 0);
CALL new_item('Elixir of the Mongoose', 5, 7);
CALL new_item('Sulfuras, Hand of Ragnaros', 0, 80);
CALL new_item('Sulfuras, Hand of Ragnaros', -1, 80);
CALL new_item('Backstage passes to a TAFKAL80ETC concert', 15, 20);
CALL new_item('Backstage passes to a TAFKAL80ETC concert', 10, 49);
CALL new_item('Backstage passes to a TAFKAL80ETC concert', 5, 49);
-- this conjured item does not work properly yet ;
CALL new_item('Conjured Mana Cake', 3, 6);
CALL new_item('Sports Memorabilia', 10, 20);
CALL new_item('Aged Cheese', 2, 0);
CALL new_item('Coffee Table Book', 5, 7);
CALL new_item('Fine Italian Silk', 0, 80);
CALL new_item('Fine Italian Silk', -1, 80);
CALL new_item('Backstage passes to a concert', 15, 20);
CALL new_item('Backstage passes to a concert', 10, 49);
CALL new_item('Backstage passes to a concert', 5, 49);
-- this Baked item does not work properly yet ;
CALL new_item('Baked Chocolate Cake', 3, 6);
days := 1;
-- when
@ -62,29 +62,29 @@ BEGIN
END LOOP;
-- then
expected := ARRAY[
expected := ARRAY[
'-------- day 0 --------',
'name, sellIn, quality',
'+5 Dexterity Vest, 10, 20',
'Aged Brie, 2, 0',
'Backstage passes to a TAFKAL80ETC concert, 5, 49',
'Backstage passes to a TAFKAL80ETC concert, 10, 49',
'Backstage passes to a TAFKAL80ETC concert, 15, 20',
'Conjured Mana Cake, 3, 6',
'Elixir of the Mongoose, 5, 7',
'Sulfuras, Hand of Ragnaros, -1, 80',
'Sulfuras, Hand of Ragnaros, 0, 80',
'Sports Memorabilia, 10, 20',
'Aged Cheese, 2, 0',
'Backstage passes to a concert, 5, 49',
'Backstage passes to a concert, 10, 49',
'Backstage passes to a concert, 15, 20',
'Baked Chocolate Cake, 3, 6',
'Coffee Table Book, 5, 7',
'Fine Italian Silk, -1, 80',
'Fine Italian Silk, 0, 80',
'-------- day 1 --------',
'name, sellIn, quality',
'+5 Dexterity Vest, 9, 19',
'Aged Brie, 1, 1',
'Backstage passes to a TAFKAL80ETC concert, 4, 50',
'Backstage passes to a TAFKAL80ETC concert, 9, 50',
'Backstage passes to a TAFKAL80ETC concert, 14, 21',
'Conjured Mana Cake, 2, 5',
'Elixir of the Mongoose, 4, 6',
'Sulfuras, Hand of Ragnaros, -1, 80',
'Sulfuras, Hand of Ragnaros, 0, 80'
'Sports Memorabilia, 9, 19',
'Aged Cheese, 1, 1',
'Backstage passes to a concert, 4, 50',
'Backstage passes to a concert, 9, 50',
'Backstage passes to a concert, 14, 21',
'Baked Chocolate Cake, 2, 5',
'Coffee Table Book, 4, 6',
'Fine Italian Silk, -1, 80',
'Fine Italian Silk, 0, 80'
];
perform test_assertEquals_golden_master(expected, result);
@ -92,4 +92,4 @@ END;
$$ LANGUAGE plpgsql;
SELECT * FROM test_run_all();
SELECT * FROM test_run_all();

View File

@ -18,16 +18,16 @@ BEGIN
l_sell_in := l_item.sell_in;
l_quality := l_item.quality;
IF l_name <> 'Aged Brie' AND l_name <> 'Backstage passes to a TAFKAL80ETC concert' THEN
IF l_name <> 'Aged Cheese' AND l_name <> 'Backstage passes to a concert' THEN
IF l_quality > 0 THEN
IF l_name <> 'Sulfuras, Hand of Ragnaros' THEN
IF l_name <> 'Fine Italian Silk' THEN
l_quality := l_quality - 1;
END IF;
END IF;
ELSE
IF (l_quality < 50) THEN
l_quality := l_quality + 1;
IF l_name = 'Backstage passes to a TAFKAL80ETC concert' THEN
IF l_name = 'Backstage passes to a concert' THEN
IF l_sell_in < 11 THEN
IF l_quality < 50 THEN
l_quality := l_quality + 1;
@ -42,15 +42,15 @@ BEGIN
END IF;
END IF;
IF l_name <> 'Sulfuras, Hand of Ragnaros' THEN
IF l_name <> 'Fine Italian Silk' THEN
l_sell_in := l_sell_in - 1;
END IF;
IF l_sell_in < 0 THEN
IF l_name <> 'Aged Brie' THEN
IF l_name <> 'Backstage passes to a TAFKAL80ETC concert' THEN
IF l_name <> 'Aged Cheese' THEN
IF l_name <> 'Backstage passes to a concert' THEN
IF l_quality > 0 THEN
IF l_name <> 'Sulfuras, Hand of Ragnaros' THEN
IF l_name <> 'Fine Italian Silk' THEN
l_quality := l_quality - 1;
END IF;
END IF;

View File

@ -10,16 +10,16 @@ CREATE OR REPLACE PACKAGE BODY texttest IS
BEGIN
DELETE FROM 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);
new_item('Sports Memorabilia', 10, 20);
new_item('Aged Cheese', 2, 0);
new_item('Coffee Table Book', 5, 7);
new_item('Fine Italian Silk', 0, 80);
new_item('Fine Italian Silk', -1, 80);
new_item('Backstage passes to a concert', 15, 20);
new_item('Backstage passes to a concert', 10, 49);
new_item('Backstage passes to a concert', 5, 49);
-- this Baked item does not work properly yet ;
new_item('Baked Chocolate Cake', 3, 6);
END setup;
PROCEDURE main_test IS
@ -36,25 +36,25 @@ CREATE OR REPLACE PACKAGE BODY texttest IS
put_line(v_expected, 'OMGHAI!');
put_line(v_expected, '-------- day 0 --------');
put_line(v_expected, 'name, sellIn, quality');
put_line(v_expected, '+5 Dexterity Vest, 10, 20' || co_lf || 'Aged Brie, 2, 0');
put_line(v_expected, 'Elixir of the Mongoose, 5, 7');
put_line(v_expected, 'Sulfuras, Hand of Ragnaros, 0, 80');
put_line(v_expected, 'Sulfuras, Hand of Ragnaros, -1, 80');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 15, 20');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 10, 49');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 5, 49');
put_line(v_expected, 'Conjured Mana Cake, 3, 6');
put_line(v_expected, 'Sports Memorabilia, 10, 20' || co_lf || 'Aged Cheese, 2, 0');
put_line(v_expected, 'Coffee Table Book, 5, 7');
put_line(v_expected, 'Fine Italian Silk, 0, 80');
put_line(v_expected, 'Fine Italian Silk, -1, 80');
put_line(v_expected, 'Backstage passes to a concert, 15, 20');
put_line(v_expected, 'Backstage passes to a concert, 10, 49');
put_line(v_expected, 'Backstage passes to a concert, 5, 49');
put_line(v_expected, 'Baked Chocolate Cake, 3, 6');
put_line(v_expected, '-------- day 1 --------');
put_line(v_expected, 'name, sellIn, quality');
put_line(v_expected, '+5 Dexterity Vest, 9, 19');
put_line(v_expected, 'Aged Brie, 1, 1');
put_line(v_expected, 'Elixir of the Mongoose, 4, 6');
put_line(v_expected, 'Sulfuras, Hand of Ragnaros, 0, 80');
put_line(v_expected, 'Sulfuras, Hand of Ragnaros, -1, 80');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 14, 21');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 9, 50');
put_line(v_expected, 'Backstage passes to a TAFKAL80ETC concert, 4, 50');
put_line(v_expected, 'Conjured Mana Cake, 2, 5');
put_line(v_expected, 'Sports Memorabilia, 9, 19');
put_line(v_expected, 'Aged Cheese, 1, 1');
put_line(v_expected, 'Coffee Table Book, 4, 6');
put_line(v_expected, 'Fine Italian Silk, 0, 80');
put_line(v_expected, 'Fine Italian Silk, -1, 80');
put_line(v_expected, 'Backstage passes to a concert, 14, 21');
put_line(v_expected, 'Backstage passes to a concert, 9, 50');
put_line(v_expected, 'Backstage passes to a concert, 4, 50');
put_line(v_expected, 'Baked Chocolate Cake, 2, 5');
put_line(v_result, 'OMGHAI!');
l_days := 2;
@ -75,4 +75,4 @@ CREATE OR REPLACE PACKAGE BODY texttest IS
ut.expect(v_result).to_equal(v_expected);
END;
END texttest;
/
/

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