Skip to content

Instantly share code, notes, and snippets.

@nickb-minted
Created July 28, 2015 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickb-minted/f8ced2d64088fb05e3e3 to your computer and use it in GitHub Desktop.
Save nickb-minted/f8ced2d64088fb05e3e3 to your computer and use it in GitHub Desktop.
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