# The Trials Help!

**URL:** <https://discourse.codecombat.com/t/the-trials-help/2709>\
**Category:** Adventurer\
**Created:** [February 15, 2015, 6:35am UTC](https://discourse.codecombat.com/t/the-trials-help/2709 "2015-02-15T06:35:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [February 15, 2015, 6:35am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/1 "2015-02-15T06:35:02Z")

</div>

I keep on dying near the end because I only have a little amount of 851 health ![](https://sea2.discourse-cdn.com/flex016/uploads/codecombat/2055/a6df066dd124bae9.png)  
here is my code. ☹

```python
loop{
var enemy = this.findNearestEnemy();
if(enemy) {
this.attack(enemy);
this.bash(enemy);
}
var flag = this.findFlag();
if(flag){
this.pickUpFlag(flag);
}
}

```

---

<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:** [February 15, 2015, 6:43pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/2 "2015-02-15T18:43:48Z")

</div>

The trials are intended as a very hard and challenging level. You either need brute-force and huge amounts of HP, or a clever tactic. There is already a discussion about the trials ongoing, which is, at the time of this post, on the first page and as such easy to find with a little bit of effort.

[http://discourse.codecombat.com/t/has-anyone-beaten-the-trials-on-a-free-account/2683?u=j\_f\_b\_m](http://discourse.codecombat.com/t/has-anyone-beaten-the-trials-on-a-free-account/2683?u=j_f_b_m)

---

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [February 15, 2015, 6:53pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/3 "2015-02-15T18:53:23Z")

</div>

I am a subscriber

```python
loop {
    var flag = this.findFlag();
    var enemy = this.findNearestEnemy();
    if (flag) {
        this.pickUp(flag)
    } else if(enemy) {
        this.attack(enemy);
        this.bash(enemy);
}
}

```

---

<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:** [February 15, 2015, 7:21pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/4 "2015-02-15T19:21:48Z")

</div>

Did you acutally read the linked topic?

I didn’t link the topic because I think you are not a subscriber, but to show that this level needs a lot of tactic. Dodging, kiting ect.  
You’re code is not exactly… complicated. More the brute-force approach. And bugged (you don’t check if bash is ready).

* * *

On a side-note: Please, **Please** indent you code. It improves readability so much (the usual indentation is 4 spaces).

---

<div class="post-metadata">

**Author:** ![sotonin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sotonin/32/24089_2.png) [@sotonin](https://discourse.codecombat.com/u/sotonin)\
**Post date:** [February 15, 2015, 7:22pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/5 "2015-02-15T19:22:16Z")

</div>

Try reading some of the threads that already discuss strategies. Again, the level is intended to be hard and require a lot of planning and strategy. So don’t feel bad if you can’t beat it. just keep trying and experimenting

---

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [February 15, 2015, 7:45pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/6 "2015-02-15T19:45:43Z")

</div>

But I only have 851 health and it is no match for Kevin Holland

---

<div class="post-metadata">

**Author:** ![sotonin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sotonin/32/24089_2.png) [@sotonin](https://discourse.codecombat.com/u/sotonin)\
**Post date:** [February 15, 2015, 8:25pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/8 "2015-02-15T20:25:35Z")

</div>

Again. it’s intended to be challenging and we won’t give you full code to complete it. That’s the whole point. It’s an optional level and something to work towards. If you need to improve your gear, then work on that.

Somebody in that thread who beat it said they had 864 health. so it’s possible. You just need to improve your strategy.

---

<div class="post-metadata">

**Author:** ![Loser5](https://avatars.discourse-cdn.com/v4/letter/l/d9b06d/32.png) [@Loser5](https://discourse.codecombat.com/u/Loser5)\
**Post date:** [February 16, 2015, 4:31am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/9 "2015-02-16T04:31:42Z")

</div>

One tip for you, is to attack the enemies a bit out of order. I kill the ones in the SW corner, then the ones in the NW and NE corners. Note the mushrooms won’t spawn until everything is killed at the previous part so when you need to heal go back and kill the enemies in the SE corner so that you can heal up.

Also, there are some options to optimize your code. Think about it this way. In each loop, you want to attack as many times as possible. If there are 10 statements executed each iteration of the loop, and only one of them is an attack you are only attacking 10% of the time.

If you can branch the code so that you’re executing less statements per iteration, you will get more DPS. So that you understand what I’m explaining, I’ll use your code as an example:

```python
var enemy = this.findNearestEnemy();
loop{
if(enemy) {
   this.attack(enemy);
   this.bash(enemy);
}
else {
   enemy = this.findNearestEnemy();
}

```

* * *

You see with this minor change, the else only fires and find enemy statement only execute after something dies. 😄

Another tip to consider is the powerup for your weapon. This will do a lot more damage than a regular attack.

Good luck,

---

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [February 16, 2015, 5:14am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/10 "2015-02-16T05:14:50Z")

</div>

Did he/she use the knight?

---

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [February 16, 2015, 5:24am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/11 "2015-02-16T05:24:04Z")

</div>

I tried but I died. Whaaaaa

---

<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:** [February 16, 2015, 1:54pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/14 "2015-02-16T13:54:05Z")

</div>

Please explain the purpose of the last two posts. You speak to yourself and throw some random generic code-snippets at us. Please write a bit more text to explain yourself.

---

<div class="post-metadata">

**Author:** ![sotonin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sotonin/32/24089_2.png) [@sotonin](https://discourse.codecombat.com/u/sotonin)\
**Post date:** [February 16, 2015, 2:46pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/15 "2015-02-16T14:46:39Z")

</div>

I guarantee this level is too hard for you shoodong. Just don’t play it.

---

<div class="post-metadata">

**Author:** ![ninja\_star](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@ninja\_star](https://discourse.codecombat.com/u/ninja_star)\
**Post date:** [March 17, 2015, 10:03pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/16 "2015-03-17T22:03:24Z")

</div>

What hero should I do? I am a non-paying player. I have the hardened steel glasses, claymore, painted steel breastplate, steel helmet, my boss star, steel striker shield, quartz sense stone, the worker’s gloves, boot of jumping and reinforced boots, the steel ring, the engraved wristwatch, basic flags, bear trap belt, and Hattori, Tharain, and Anya. And no gems left.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)\
**Post date:** [March 17, 2015, 10:16pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/17 "2015-03-17T22:16:06Z")

</div>

Unless you’re doing a speed-focused strategy, Anya or Tharin will probably work better than Hattori, since Hattori is really easy to kill, and you don’t need his extra damage except on the bosses. But it might not be possible, so you’ll just have to make your strategy as efficient as possible and see if you can do it yet. (I bet using the boss star to get soldiers on your side would help a bunch if you can keep them alive.)

---

<div class="post-metadata">

**Author:** ![ninja\_star](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@ninja\_star](https://discourse.codecombat.com/u/ninja_star)\
**Post date:** [March 18, 2015, 12:07am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/18 "2015-03-18T00:07:41Z")

</div>

Why do you need to keep them alive?

---

<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:** [March 18, 2015, 12:23am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/19 "2015-03-18T00:23:24Z")

</div>

A distraction at the right time can save your precious HP. On the other hand, you could take the enemy’s damage and let the soldiers help you for some extra damage.  
Even though ideas have been mentioned we (collectively) have no idea what for awesome tactics are all possible with the boss star.

---

<div class="post-metadata">

**Author:** ![Feinty](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/feinty/32/1869_2.png) [@Feinty](https://discourse.codecombat.com/u/Feinty)\
**Post date:** [March 18, 2015, 12:26am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/20 "2015-03-18T00:26:34Z")

</div>

Just imagine an army against the oracle

---

<div class="post-metadata">

**Author:** ![shoodong](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/shoodong/32/2361_2.png) [@shoodong](https://discourse.codecombat.com/u/shoodong)\
**Post date:** [March 30, 2015, 9:44pm UTC](https://discourse.codecombat.com/t/the-trials-help/2709/21 "2015-03-30T21:44:18Z")

</div>

**I beat [the trials](https://codecombat.com/play/level/the-trials) finally!**  
 ![](https://sea2.discourse-cdn.com/flex016/uploads/codecombat/2240/d1c4ba43cc9b4727.png)

---

<div class="post-metadata">

**Author:** ![nathangd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nathangd/32/3617_2.png) [@nathangd](https://discourse.codecombat.com/u/nathangd)\
**Post date:** [January 15, 2016, 2:40am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/22 "2016-01-15T02:40:41Z")

</div>

nick or anyone… i cant seem to “skip” over this level look & plus i can’t beat it;

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/7/711dd12ff8a35b08850f7749881968f31955d85d.png)

---

<div class="post-metadata">

**Author:** ![UltCombo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ultcombo/32/3822_2.png) [@UltCombo](https://discourse.codecombat.com/u/UltCombo)\
**Post date:** [January 15, 2016, 2:54am UTC](https://discourse.codecombat.com/t/the-trials-help/2709/23 "2016-01-15T02:54:13Z")

</div>

“The Trials” is not part of the main campaign line, you can skip it for now and come back later. There are two other levels that you apparently have not beaten yet (red circles with white border). Beat those and you should be able to progress further in the main campaign.

[Next page](https://discourse.codecombat.com/t/the-trials-help/2709.md?page=2)
