How to clear Kithgard Mastery,someone help?

I son’t know how to clear this level (Kithgard Mastery),someone can help me?

From the help:

This is a special challenge level intended to allow players who have some programming
experience to skip most of the Dungeon levels and go straight into the
Forest World.
The mazes and passwords are randomly generated, so you can’t just copy from someone else’s code.
If you can’t beat this level, don’t worry! Keep playing through the
rest of the Dungeon levels and you’ll learn what you need to know!

Use basic move, attack, and say functions while keeping track of your gem count in a variable. You can also loop as each sections appears to happen twice.

Let me know if you have a more specific question.

Thank for your ask,I will show you my code and please help me to make it correct!
//I can’t move over the fire trap!

The following is my code:
this.moveRight();
this.moveUp(2);
enemy = this.findNearestEnemy();
this.attack(enemy);
this.attack(enemy);
this.moveLeft();
this.moveUp(2);
this.moveRight(2);
this.moveUp();
this.moveDown();
this.moveRight();
this.moveDown(3);
this.say(“the current count when near a fireball trap to disable it.”);

Hello, Jonathan, and welcome. Please format your code according to the FAQ.

You weren’t supposed to take the way to disable the fireball traps literally. What you have to say is the number of gems you have collected so far.

Hmm…apparently arithmetic isn’t covered in the Dungeon levels, and that’s necessary to complete the level.

So, to count your gems, you’ll want to do the below:

# define your gem counter outside the loop
gems = 0 # this is just a variable assignment; you've seen these before with enemy = self.findNearestEnemy()
loop:
    # then once you pick up a gem, you can do the below
    gems = gems + 1 # this makes gems equal the previous gem count plus 1
    # or you could do `gems += 1`
    # then you could just self.say(gems) when you need to
1 Like

Thanks!! :smiley: Very most usefull! :smiley:

I have been trying this and can’t get it to work can anyone correct my error please
// Reach the end of the maze using move commands.
// Count how many gems you pick up, and then say the current count when near a fireball trap to disable it.
// The raven at the start will give you a password. Say the password near a door to open it.
// Kill ogres when you get near them.
// You can use a loop to repeat all of the instructions as needed.
// If you beat this level, you can skip to the Forest World!
var gems=0 + 1;
loop {
hero.moveUp();
hero.moveRight(3);
hero.moveUp();
var gems = gems ++;
hero.moveDown();
hero.moveRight();
hero.say(“Abracadabra”);
hero.moveRight(2);
hero.moveUp(1);

hero.say(“gems”);
hero.moveUp(2);
var enemy = hero.findNearestEnemy();
hero.moveLeft(4);
hero.moveUp(2);

}

Here’s my complete code, it is written in Python.
Your character does say gems then gemes because I couldn’t get it to line up with the fireball traps and the amount of gems you collect.
[Please don’t post solutions]

Since you already completed the level id like to give advice that might help. What I did was add the statement Gem += 1 right after the move method that you call in order to get the gem.

How do you disable the trap. The traps is called the ElectroWall. How do I disable it?

You disable it by saying how many gems you currently have.

are you sure, just tried that and it doesn’t work

Please don’t revive dead threads. :slight_smile: