`// Recruit soldiers and archers to fill out each squadron.
// Each paladin has a decimal number stored in her deployment attribute.
// Convert these to binary and represent them with line soldiers and archers next to each paladin.
// Soldiers are 0s, archers are 1s.
// For the bonus goal, add griffins as 2s for trinary number lines next to the warlocks.
// Check the guide for help with binary numbers.
this.paladins = this.findByType(“paladin”, this.findFriends());
//this.say(this.paladins.length);
for (var i = 0; i < this.paladins.length; i++) {
var line = this.paladins[i].deployment.toString(2);
for (var j = 0; j < line.length; j++) {
if (line[j] == “0”) {
this.summon(“soldier”);
} else {
this.summon(“archer”);
}
var friend = this.built[this.built.length - 1];
this.command(friend, “move”, {
x: this.paladins[i].pos.x + 8 + 8 * j,
y: this.paladins[i].pos.y
});
}
}
`