# Shine Getter / Sarven Shepard

**URL:** <https://discourse.codecombat.com/t/shine-getter-sarven-shepard/5855>\
**Category:** Uncategorized\
**Created:** [December 2, 2015, 10:03am UTC](https://discourse.codecombat.com/t/shine-getter-sarven-shepard/5855 "2015-12-02T10:03:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Millsy88](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Millsy88](https://discourse.codecombat.com/u/Millsy88)\
**Post date:** [December 2, 2015, 10:03am UTC](https://discourse.codecombat.com/t/shine-getter-sarven-shepard/5855/1 "2015-12-02T10:03:36Z")

</div>

Hi

I’ve completed both Sarven Shepard and Shine Getter,but I’m struggling to grasp a few of what I imagine are the key take aways / learning points.

My code for Shine Getter was:

```python
loop:
    coins = self.findItems()
    coinIndex = 0
    
    # Wrap this into a loop that iterates over all coins.
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        coinIndex += 1
 # Gold coins are worth 3.
        if coin.value == 3:
    # Only pick up gold coins.
            pos = coin.pos
            x = pos.x
            y = pos.y
            self.moveXY(x, y)

```

What I’m finding hard to grasp is why the code doesn’t run when I use the following:

```python
while coinIndex < 100:

```

or

```python
coinIndex += coin.value

```

Whenever I try running the code with the above my char just sits there or I get an error. Yet as far as I can work out, they should both work?

What am I missing / not getting?

---

<div class="post-metadata">

**Author:** ![ChronistGilver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chronistgilver/32/3778_2.png) [@ChronistGilver](https://discourse.codecombat.com/u/ChronistGilver)\
**Post date:** [December 2, 2015, 1:56pm UTC](https://discourse.codecombat.com/t/shine-getter-sarven-shepard/5855/2 "2015-12-02T13:56:50Z")

</div>

For the first one, you assume there are at least one hundred coins. But if there are only fifty coins, you can’t try to collect a fifty-first coin, which is what you will try to do.

As for the second, you want to loop over each coin, one at a time. If you add the value of a coin, and it is not a bronze coin, you will be skipping coins.
