mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
added (no) for negative path in if-statements
This commit is contained in:
parent
632a6768eb
commit
ff06861ab7
@ -10,7 +10,9 @@ if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (y
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
@ -19,19 +21,26 @@ else (no)
|
|||||||
if (sell in < 11) then (yes)
|
if (sell in < 11) then (yes)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
if (sell in < 6) then (yes)
|
if (sell in < 6) then (yes)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower sell in with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (sell in < 0) then (yes)
|
if (sell in < 0) then (yes)
|
||||||
@ -40,7 +49,9 @@ if (sell in < 0) then (yes)
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
-lower quality with quality
|
-lower quality with quality
|
||||||
@ -48,8 +59,10 @@ if (sell in < 0) then (yes)
|
|||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
@ -7,11 +7,11 @@ note left
|
|||||||
end note
|
end note
|
||||||
|
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
|
||||||
-lower sell in with 1
|
-lower sell in with 1
|
||||||
|
|
||||||
if (sell in < 0) then (yes)
|
if (sell in < 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
@ -8,6 +8,7 @@ end note
|
|||||||
|
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
-lower sell in with 1
|
-lower sell in with 1
|
||||||
@ -15,7 +16,9 @@ endif
|
|||||||
if (sell in < 0) then (yes)
|
if (sell in < 0) then (yes)
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
@ -9,6 +9,7 @@ end note
|
|||||||
if (not "Aged Brie") then (yes)
|
if (not "Aged Brie") then (yes)
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
@ -20,10 +21,12 @@ if (sell in < 0) then (yes)
|
|||||||
if (not "Aged Brie") then (yes)
|
if (not "Aged Brie") then (yes)
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
@ -9,10 +9,12 @@ end note
|
|||||||
if (not "Aged Brie") then (yes)
|
if (not "Aged Brie") then (yes)
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -22,10 +24,12 @@ if (sell in < 0) then (yes)
|
|||||||
if (not "Aged Brie") then (yes)
|
if (not "Aged Brie") then (yes)
|
||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -10,16 +10,20 @@ if (not "Aged Brie") then (yes)
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower sell in with 1
|
-lower sell in with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (sell in < 0) then (yes)
|
if (sell in < 0) then (yes)
|
||||||
@ -27,13 +31,17 @@ if (sell in < 0) then (yes)
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
@ -10,7 +10,9 @@ if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (y
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
@ -19,19 +21,26 @@ else (no)
|
|||||||
if (sell in < 11) then (yes)
|
if (sell in < 11) then (yes)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
if (sell in < 6) then (yes)
|
if (sell in < 6) then (yes)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower sell in with 1
|
-lower sell in with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (sell in < 0) then (yes)
|
if (sell in < 0) then (yes)
|
||||||
@ -40,7 +49,9 @@ if (sell in < 0) then (yes)
|
|||||||
if (quality > 0) then (yes)
|
if (quality > 0) then (yes)
|
||||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||||
-lower quality with 1
|
-lower quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
else (no)
|
else (no)
|
||||||
-lower quality with quality
|
-lower quality with quality
|
||||||
@ -48,8 +59,10 @@ if (sell in < 0) then (yes)
|
|||||||
else (no)
|
else (no)
|
||||||
if (quality < 50) then (yes)
|
if (quality < 50) then (yes)
|
||||||
-increase quality with 1
|
-increase quality with 1
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
else (no)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop
|
stop
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user