Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

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:
enemy = this.findNearestEnemy();
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()
    # 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


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 {
var gems = gems ++;

var enemy = hero.findNearestEnemy();



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: