GildedRose.UpdateQuality ( this -- )


Vocabulary
gilded-rose

Inputs
thisan object


Outputs
None

Definition


:: GildedRose.UpdateQuality ( this -- )
this Items>> length [| i |
i this Items>> nth Name>> "Aged Brie" =
not i this Items>> nth
Name>> "Backstage passes to a TAFKAL80ETC concert" =
not and [
i this Items>> nth Quality>> 0 > [
i this Items>> nth
Name>> "Sulfuras, Hand of Ragnaros" = not [
i this Items>> nth Quality>> 1 -
i this Items>> nth Quality<<
] when
] when
] [
i this Items>> nth Quality>> 50 < [
i this Items>> nth Quality>> 1 +
i this Items>> nth Quality<< i this Items>> nth
Name>>
"Backstage passes to a TAFKAL80ETC concert" = [
i this Items>> nth SellIn>> 11 < [
i this Items>> nth Quality>> 50 <
~quotation~ when
] when i this Items>> nth SellIn>> 6 < [
i this Items>> nth Quality>> 50 <
~quotation~ when
] when
] when
] when
] if i this Items>> nth
Name>> "Sulfuras, Hand of Ragnaros" = not [
i this Items>> nth SellIn>> 1 - i this Items>> nth
SellIn<<
] when i this Items>> nth SellIn>> 0 < [
i this Items>> nth Name>> "Aged Brie" = not [
i this Items>> nth
Name>>
"Backstage passes to a TAFKAL80ETC concert" =
not [
i this Items>> nth Quality>> 0 > [
i this Items>> nth
Name>> "Sulfuras, Hand of Ragnaros" =
not ~quotation~ when
] when
] [
i this Items>> nth
Quality>> i this Items>> nth Quality>> -
i this Items>> nth Quality<<
] if
] [
i this Items>> nth Quality>> 50 < [
i this Items>> nth Quality>> 1 +
i this Items>> nth Quality<<
] when
] if
] when
] each-integer ;