Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Cloudrip Commander python

#1

Its saying fix your code line 11 try self.findfriends but i am following what it says on the item

#Summon some soldiers, then direct them to your base.

#Each soldier costs 20 gold.
while self.gold > self.costOf("soldier"):
    self.summon("soldier")
soldiers = self.findFriends() #Define these OUTSIDE the while-loop
soldierIndex = 0
#Add a while loop to command all the soldiers.
while (soldierIndex < len(soldiers)):
    #Do all your actions here
    friend = self.getNearestFriend()
    self.command(friend, 'move', self.pos)
#Go join your comrades!
  self.moveXY(50, 41)
#2

nvm i beat it with a self.moveXY(50,40)

#3

It could be an indentation problem. Note the two spaces before self.moveXY(50, 41) in your code.

#4

Doesn’t work for me either,

#5

Daniel post formated code (see forum FAQ) and the specific issue you have problems with. The code about uses:

self.getNearestFriend()

which is not a function. Look at the available functions listed bellow your code editor

#6

It’s hero.findNearestFriend

#7

You are replying to someone who has not been seen on this board for over two years.