Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李楚霏
/
refactorTest
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2f6ab9a7
authored
Feb 08, 2020
by
李楚霏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
step3 --- clean up
parent
fbc6f18b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
gildedRose/src/gilded-rose.js
+27
-27
No files found.
gildedRose/src/gilded-rose.js
View file @
2f6ab9a7
...
...
@@ -8,55 +8,55 @@ export class GildedRose {
update_quality
()
{
for
(
let
i
=
0
;
i
<
this
.
items
.
length
;
i
++
)
{
for
(
const
item
of
this
.
items
)
{
if
(
this
.
items
[
i
]
.
name
!=
'Aged Brie'
&&
this
.
items
[
i
]
.
name
!=
'Backstage passes to a TAFKAL80ETC concert'
item
.
name
!=
'Aged Brie'
&&
item
.
name
!=
'Backstage passes to a TAFKAL80ETC concert'
)
{
if
(
this
.
items
[
i
]
.
quality
>
0
)
{
if
(
this
.
items
[
i
]
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
-
1
if
(
item
.
quality
>
0
)
{
if
(
item
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
item
.
quality
=
item
.
quality
-
1
}
}
}
else
{
if
(
this
.
items
[
i
]
.
quality
<
50
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
+
1
if
(
item
.
quality
<
50
)
{
item
.
quality
=
item
.
quality
+
1
if
(
this
.
items
[
i
]
.
name
==
'Backstage passes to a TAFKAL80ETC concert'
item
.
name
==
'Backstage passes to a TAFKAL80ETC concert'
)
{
if
(
this
.
items
[
i
]
.
sell_in
<
11
)
{
if
(
this
.
items
[
i
]
.
quality
<
50
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
+
1
if
(
item
.
sell_in
<
11
)
{
if
(
item
.
quality
<
50
)
{
item
.
quality
=
item
.
quality
+
1
}
}
if
(
this
.
items
[
i
]
.
sell_in
<
6
)
{
if
(
this
.
items
[
i
]
.
quality
<
50
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
+
1
if
(
item
.
sell_in
<
6
)
{
if
(
item
.
quality
<
50
)
{
item
.
quality
=
item
.
quality
+
1
}
}
}
}
}
if
(
this
.
items
[
i
]
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
this
.
items
[
i
].
sell_in
=
this
.
items
[
i
]
.
sell_in
-
1
if
(
item
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
item
.
sell_in
=
item
.
sell_in
-
1
}
if
(
this
.
items
[
i
]
.
sell_in
<
0
)
{
if
(
this
.
items
[
i
]
.
name
!=
'Aged Brie'
)
{
if
(
item
.
sell_in
<
0
)
{
if
(
item
.
name
!=
'Aged Brie'
)
{
if
(
this
.
items
[
i
]
.
name
!=
'Backstage passes to a TAFKAL80ETC concert'
item
.
name
!=
'Backstage passes to a TAFKAL80ETC concert'
)
{
if
(
this
.
items
[
i
]
.
quality
>
0
)
{
if
(
this
.
items
[
i
]
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
-
1
if
(
item
.
quality
>
0
)
{
if
(
item
.
name
!=
'Sulfuras, Hand of Ragnaros'
)
{
item
.
quality
=
item
.
quality
-
1
}
}
}
else
{
this
.
items
[
i
]
.
quality
=
this
.
items
[
i
].
quality
-
this
.
items
[
i
]
.
quality
item
.
quality
=
item
.
quality
-
item
.
quality
}
}
else
{
if
(
this
.
items
[
i
]
.
quality
<
50
)
{
this
.
items
[
i
].
quality
=
this
.
items
[
i
]
.
quality
+
1
if
(
item
.
quality
<
50
)
{
item
.
quality
=
item
.
quality
+
1
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment