# About the "Cloudrip Commander"?

**URL:** <https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360>\
**Category:** Uncategorized\
**Created:** [April 3, 2015, 3:40pm UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360 "2015-04-03T15:40:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hui](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hui](https://discourse.codecombat.com/u/Hui)\
**Post date:** [April 3, 2015, 3:40pm UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360/1 "2015-04-03T15:40:59Z")

</div>

Hi,Could anyone give me hints or tips about the code?

```python
while self.gold > self.costOf("soldier"):
self.summon("soldier")
soldiers = self.findFriends()
soldierIndex = 0
soldier = soldiers[soldierIndex]
self.command(soldier, "move", {"x": 50, "y": 40})

```

## I tried many ways but I could not common another one to move. If anyone could give me some hints…Thank you very much!

Thanks for **bmmtstb** and **J\_F\_B\_M** , I passed the point.  
Other players can check 2 pints **“Shine Getter”** and **“Sarven Shepherd”** in the **Desert.** The way is similar to these points.

---

<div class="post-metadata">

**Author:** ![bmmtstb](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bmmtstb/32/12265_2.png) [@bmmtstb](https://discourse.codecombat.com/u/bmmtstb)\
**Post date:** [April 3, 2015, 4:03pm UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360/2 "2015-04-03T16:03:54Z")

</div>

first of all, while u dont change soldierIndex u always command soldiers[0]… use a while for increasing limit of soldierIndex  
second… i think you had been explained to use “for” loops. that means for soldier in soldiers: do sth

---

<div class="post-metadata">

**Author:** ![J\_F\_B\_M](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/j_f_b_m/32/2756_2.png) [@J\_F\_B\_M](https://discourse.codecombat.com/u/J_F_B_M)\
**Post date:** [April 3, 2015, 9:57pm UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360/3 "2015-04-03T21:57:51Z")

</div>

Hui, you have already been told how to present your code properly. While using the quote-feature is creative, it is not the right way. If you don’t remember what I wrote you, please read the FAQ.

* * *

As bmmtstb already mentioned, you never increase `soldierIndex`. Not only that, but you always set it explicitly to `0`. Move the `soldierIndex = 0` in front of the while and do `soldierIndex += 1` at the end of your while.

---

<div class="post-metadata">

**Author:** ![Hui](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hui](https://discourse.codecombat.com/u/Hui)\
**Post date:** [April 4, 2015, 1:06am UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360/4 "2015-04-04T01:06:03Z")

</div>

Thank you for the correction.  
I has read it again,I need to use triple backticks.  
I will try my codes again…thank you!

---

<div class="post-metadata">

**Author:** ![Hui](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hui](https://discourse.codecombat.com/u/Hui)\
**Post date:** [April 4, 2015, 1:07am UTC](https://discourse.codecombat.com/t/about-the-cloudrip-commander/3360/5 "2015-04-04T01:07:08Z")

</div>

Thank you for the tips.  
I will try it today.  
Thank you very much.
