The Second Kithmaze, Level 9, Kithguard dungeon


#1

Here is my code for this level:

loop:
    self.moveRight(1)
    self.moveUp(1)
    self.moveRight(1)
    self.moveDown(1)

The game repeatedly tells me I have failed to complete level in under 6 statements. As you can see there are 5 lines here. For context the aim is to complete a maze using a loop or while-true statement. I have replaced the loop for while true and still get the same result.

The character completes the task as expected but I cannot advance any further because of my exceeding the statements. I watched the help video and the guy there does what appears to me to be exactly the same (5 lines) but he passes it.

Any ideas guys? Thanks in advance.


#2

Hello, Dan, and welcome. Please read the FAQ before posting again. It is essential that you learn how to format your code properly. I’ve done it for you this time, but you must do so yourself in the future.

Statements are different from lines. Each number is a statement. You currently have 9 statements, which fails the goal. Just remove the 1 and you’ll be fine.