# Hold the Forest Pass

**URL:** <https://discourse.codecombat.com/t/hold-the-forest-pass/3094>\
**Category:** Uncategorized\
**Created:** [March 15, 2015, 5:33am UTC](https://discourse.codecombat.com/t/hold-the-forest-pass/3094 "2015-03-15T05:33:53Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [February 11, 2016, 4:57pm UTC](https://discourse.codecombat.com/t/hold-the-forest-pass/3094/21 "2016-02-11T16:57:28Z")

</div>

> [@Cayden\_Phillips](#):
>
> My hero doesn’t seem to be able to move using the flags. He just stands there with the archers. What do I do to fix it?

As @AdrianCgw mentioned, please post your code with radiant and harmonious formatting, as described in the FAQ. Phrases like ''i need help" or “i can’t figure it out” don’t help us help you. Please post your code (with formatting according to the FAQ) , what happens, and anything else that would be helpful.

Cheers! @Luke10

---

<div class="post-metadata">

**Author:** ![JIAN\_WEN\_CHIN](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@JIAN\_WEN\_CHIN](https://discourse.codecombat.com/u/JIAN_WEN_CHIN)\
**Post date:** [February 17, 2016, 8:49am UTC](https://discourse.codecombat.com/t/hold-the-forest-pass/3094/22 "2016-02-17T08:49:36Z")

</div>

Hi guys I need help in this level I hope you guys can solve my code:  
loop:  
flag = self.findFlag()  
enemy = self.findNearestEnemy()  
if flag:  
self.pickUpFlag(flag)  
else if enemy:  
distance = self.distanceTo(enemy)  
if distance \< 15 and @isReady(‘cleave’):  
self.cleave enemy  
else if distance \< 5:  
self.attack(enemy)

---

<div class="post-metadata">

**Author:** ![AdrianCgw](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@AdrianCgw](https://discourse.codecombat.com/u/AdrianCgw)\
**Post date:** [February 17, 2016, 9:36am UTC](https://discourse.codecombat.com/t/hold-the-forest-pass/3094/23 "2016-02-17T09:36:34Z")

</div>

Your code is fine, you just have a couple of semantic errors.  
When you see a red X under your hero’s feet look at your code, find the line with a red X before it and hold the mouse cursor over the red X - a popup will tell you the error  
1)

```python
if distance < 15 and @isReady('cleave'):

```

Popup says  
_Missing self keyword, should by self.isReady_

You know what to do

1. 

```python
self.cleave enemy

```

_Unexpected token, self.cleave has no effect_

Here it is a bit harder to understand what the compiler says but remember  
_unexpected token_ usually means that the compiler wants a special symbol/keyword like  
`( : . = else` and you forgot to write it

How you usually call cleave?

PS. This level is very hard without 400 amor. Just do other levels until you can buy the strongest warrior chest armor around (pointless to go half-way - buy the best or write better code).

PPS\> Format your code next time using ` (top-left keyboard) or no more help 😛

```python

```

your code here

```python

```

---

<div class="post-metadata">

**Author:** ![Cayden\_Phillips](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Cayden\_Phillips](https://discourse.codecombat.com/u/Cayden_Phillips)\
**Post date:** [February 17, 2016, 3:21pm UTC](https://discourse.codecombat.com/t/hold-the-forest-pass/3094/24 "2016-02-17T15:21:27Z")

</div>

I was scrolling through and took note of what they said and i just now was able to beat it. thank you anyway.

[Previous page](https://discourse.codecombat.com/t/hold-the-forest-pass/3094.md?page=1)
