Skip to content
Newer
Older
100644 46 lines (38 sloc) 2.21 KB
65c5a9f Initial Ruby version (with working tests)
Jim Weirich authored Feb 16, 2011
1 Hi and welcome to team Gilded Rose. As you know, we are a small inn
2 with a prime location in a prominent city ran by a friendly innkeeper
3 named Allison. We also buy and sell only the finest
4 goods. Unfortunately, our goods are constantly degrading in quality as
5 they approach their sell by date. We have a system in place that
6 updates our inventory for us. It was developed by a no-nonsense type
7 named Leeroy, who has moved on to new adventures. Your task is to add
8 the new feature to our system so that we can begin selling a new
9 category of items. First an introduction to our system:
10
11 - All items have a SellIn value which denotes the number of days we
12 have to sell the item
13 - All items have a Quality value which denotes how valuable the item
14 is
15 - At the end of each day our system lowers both values for every item
16
17 Pretty simple, right? Well this is where it gets interesting:
18
19 - Once the sell by date has passed, Quality degrades twice as fast
20 - The Quality of an item is never negative
21 - "Aged Brie" actually increases in Quality the older it gets
22 - The Quality of an item is never more than 50
23 - "Sulfuras", being a legendary item, never has to be sold or
24 decreases in Quality
25 - "Backstage passes", like aged brie, increases in Quality as it's
26 SellIn value approaches; Quality increases by 2 when there are 10
27 days or less and by 3 when there are 5 days or less but Quality
28 drops to 0 after the concert
29
30 We have recently signed a supplier of conjured items. This requires an update to our system:
31
32 - "Conjured" items degrade in Quality twice as fast as normal items
33
34 Feel free to make any changes to the UpdateQuality method and add any
35 new code as long as everything still works correctly. However, do not
36 alter the Item class or Items property as those belong to the goblin
37 in the corner who will insta-rage and one-shot you as he doesn't
38 believe in shared code ownership (you can make the UpdateQuality
39 method and Items property static if you like, we'll cover for
40 you). Your work needs to be completed by Friday, February 18, 2011
41 08:00:00 AM PST.
42
43 Just for clarification, an item can never have its Quality increase
44 above 50, however "Sulfuras" is a legendary item and as such its
45 Quality is 80 and it never alters.
Something went wrong with that request. Please try again.