-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgilded_rose.py
38 lines (36 loc) · 1.45 KB
/
gilded_rose.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class GildedRose:
def __init__(self, name, quality, days_remaining):
self.name = name
self.quality = quality
self.days_remaining = days_remaining
def tick(self):
if (
self.name != "Aged Brie"
and self.name != "Backstage passes to a TAFKAL80ETC concert"
):
if self.quality > 0:
if self.name != "Sulfuras, Hand of Ragnaros":
self.quality -= 1
else:
if self.quality < 50:
self.quality += 1
if self.name == "Backstage passes to a TAFKAL80ETC concert":
if self.days_remaining < 11:
if self.quality < 50:
self.quality += 1
if self.days_remaining < 6:
if self.quality < 50:
self.quality += 1
if self.name != "Sulfuras, Hand of Ragnaros":
self.days_remaining -= 1
if self.days_remaining < 0:
if self.name != "Aged Brie":
if self.name != "Backstage passes to a TAFKAL80ETC concert":
if self.quality > 0:
if self.name != "Sulfuras, Hand of Ragnaros":
self.quality -= 1
else:
self.quality = self.quality - self.quality
else:
if self.quality < 50:
self.quality += 1