Maan!
You rock!
Thank you.
My pleasure. (20 chars)
What is the final solution to the level? Whats the whole code look like?
We don’t give out working code, also welcome to the forums. We also don’t revive “dead topics”
Welcome to the forum. We can not give solutions but if you need help you can make a new topic.
Sorry we cant give answers
Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
wow all of us posted at the same time
bruh i need it for school. can you just give me the code to complete the level ?
Then you wouldn’t learn anything. Give us your code and we can help you.
Im running out of time but i tried to complete the level. I need to complete it for school
function findSoldierOffset(soldiers, i) {
var soldier = soldiers[i];
var angle = i * 360 / soldiers.length;
return radialToCartesian(5, angle);
}
function radialToCartesian(radius, degrees) {
var radians = Math.PI / 180 * degrees;
var xOffset = radius * Math.cos(radians);
var yOffset = radius * Math.sin(radians);
return {x: xOffset, y: yOffset};
}
var peasant = hero.findByType(“peasant”)[0];
while(true) {
var soldiers = hero.findByType("soldier");
for(var i = 0; i < soldiers.length; i ++) {
var soldier = soldiers[i];
var offset = findSoldierOffset(soldiers, i);
var x = offset.x + peasant.pos.x;
var y = offset.y + peasant.pos.y;
hero.command(soldiers, "move", {'x': x, 'y': y});
}
hero.move({x: hero.pos.x + 0.2, y: hero.pos.y});
}
Look at this and please try and write your own code.
Stop being rude and listen to the rules.
can u give me code pls. I might get bad grade in school
Well sorry I don’t do JavaScript and again no we can’t give you the code.
We can’t just give you working code. Would you learn anything if we did. No. you wouldn’t
idc if I learn anything I just need to get a good Grade !
I know some javascript so I can help you improve your code.
Dude, the point of the grade is to test you to know how advanced you are.
You are more focused on your grade than learning something and getting a good grade. If you listened to us this would have already been over
If you just told me the answer I would also be done by now