mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
gilded_rose.sh: closer to original
This commit is contained in:
parent
887ad0b60d
commit
7658124173
@ -10,42 +10,46 @@ update_quality() {
|
||||
if [[ $name != "Aged Brie" && $name != "Backstage passes to a TAFKAL80ETC concert" ]]; then
|
||||
if ((quality > 0)); then
|
||||
if [[ $name != "Sulfuras, Hand of Ragnaros" ]]; then
|
||||
((quality--))
|
||||
quality=$((quality - 1))
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if ((quality < 50)); then
|
||||
((quality++))
|
||||
quality=$((quality + 1))
|
||||
|
||||
if [[ $name == "Backstage passes to a TAFKAL80ETC concert" ]]; then
|
||||
if ((sell_in < 11)) && ((quality < 50)); then
|
||||
((quality++))
|
||||
if ((sell_in < 11)); then
|
||||
if ((quality < 50)); then
|
||||
quality=$((quality + 1))
|
||||
fi
|
||||
fi
|
||||
if ((sell_in < 6)); then
|
||||
if ((quality < 50)); then
|
||||
quality=$((quality + 1))
|
||||
fi
|
||||
if ((sell_in < 6)) && ((quality < 50)); then
|
||||
((quality++))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $name != "Sulfuras, Hand of Ragnaros" ]]; then
|
||||
((sell_in--))
|
||||
sell_in=$((sell_in - 1))
|
||||
fi
|
||||
|
||||
if ((sell_in < 0)); then
|
||||
if [[ $name != "Aged Brie" ]]; then
|
||||
if [[ $name != "Backstage passes to a TAFKAL80ETC concert" ]]; then
|
||||
if ((quality > 0)); then
|
||||
if [[ $name != "Sulfuras, Hand of Ragnaros" ]]; then
|
||||
((quality--))
|
||||
quality=$((quality - 1))
|
||||
fi
|
||||
fi
|
||||
else
|
||||
quality=0
|
||||
quality=$((quality - quality))
|
||||
fi
|
||||
else
|
||||
if ((quality < 50)); then
|
||||
((quality++))
|
||||
fi
|
||||
quality=$((quality + 1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user