Can someone send me the code for this level
This board isn’t here to provide solutions just so that you can move on to the next level. It’s here to help you find the solutions so that when you move to the next level you know how to find the solution on your own. You can’t learn to code if you don’t learn how to figure things out. Being given solutions is counter-productive to this goal. Backwoods Forest is quite easy compared to Sarven Desert and if you don’t learn the basics in this campaign, you’ll never progress in the Desert and forget Cloudrip Mountain.
Take the directions one step at a time. Don’t look at the whole thing at once or it can seem overwhelming.
- Move to the bottom X mark.
Okay, that’s easy. Just use the moveXY method to move to the bottom X coordinates.
- Create a variable named bottomEnemy and find the nearest enemy.
Easy peazy. You have an example of how to do this on line 15.
- Use the checkAndAttack function, and include the bottomEnemy variable.
Simple. Just use the exact same format that they have in line 16, except use your new variable.
Three short lines of code is all you need. Be sure to tab it over so that it’s inside the while True loop. If it’s not working, post your progress here and we’ll keep assisting until you get it.
appreciate it. i wasnt connecting it to the while true loop
Thank you so much.
My mistake was i forgot to add 4 spaces before the lines.
I had an error message for the bottom check-and-attack function but when it was said that there was an example on the line #15 or 16, I solved the error.
Thank you very much
Can someone show me how to use a VAR again.
Hi @Rylan_Nelson, welcome to the CodeCombat discourse.
Var is the method used in Javascript to introduce a variable.
It’s used like this:
var integer = 9;
var string = "Hello World";
var boolean = false
You need to put it before the name of the variable you’re creating or it won’t recognise it.
Does this solve you problem?
Danny
This would be a lot easier if the error message you get when there is a problem spoke english. I’m new to this as I’m learning this type of coding obviously, and I have no idea what the problem is when the website tells me whats wrong using words I have no idea the meaning of. I don’t want help im just pissed and wanted to tell you these messages suck.
The messages can seem a bit cryptic at first but as you learn more they will start to make sense.
To add to what @MunkeyShynes said, if you need help to understand any of the error messages, please feel free to make a topic about it and we’d be happy to help you.
Danny
And this was @MunkeyShynes last words