Created
July 28, 2015 21:12
-
-
Save nickb-minted/f8ced2d64088fb05e3e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GildedRose(object): | |
def __init__(self, name, quality, days_remaining): | |
self.name = name | |
self.quality = quality | |
self.days_remaning = 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment