Hunters and Prey serious bug

  1. Learn to program in both Python and Javascript, ask your schoolmates for help. Do not rely on code copied from internet.
    DIFFICULTY: HARD BUT WORTH IT.
1 Like

You know what my mind is getting messed up because I have many problems going on. So can someone just send me the translated code in my gmail!!Thx
PLEASE PLEASE PLEASE PLEASE
My gmail:
crummyface126@gmail.com

I switched you to Python for that level.

Oh thank u so much!!!

It says commandArcher isn’t identified on 2 to bottom line
here’s my code
please help

# Ogres are trying to kill your reindeer!
# Keep your archers back while summoning soldiers to attack.
def pickUpCoin():
    # Collect coins.
    items = self.findItems()
    nearestCoin = self.findNearest(items)
    if nearestCoin:
        self.move(nearestCoin.pos)
    pass
def summonTroops():
    # Summon soldiers if you have the gold.
    if self.costOf("soldier")<self.gold:
        self.summon("soldier")
        pass
# This function has an argument named soldier.
# Arguments are like variables.
# The value of an argument is determined when the function is called.
def commandSoldier(soldier):
    # Soldiers should attack enemies.
    for soldier in self.findFriends():
        enemy = soldier.findNearestEnemy()
        if enemy:
            self.command(soldier, "attack", enemy)
    pass
# Write a commandArcher function to tell your archers what to do!
# It should take one argument that will represent the archer passed to the function when it's called.
# Archers should only attack enemies who are closer than 25 meters, otherwise, stay still.
def commandarcher(archer):
    enemy = archer.findNearest(archer.findenemies)
    if enemy and archer.distanceto(enemy) < 25:
        self.command(archer, "attack", enemy)
    else:
        self.command(archer, "move", archer.pos)
loop:
    pickUpCoin()
    summonTroops()
    friends = self.findFriends()
    for friend in friends:
        if friend.type == "soldier":
            # This friend will be assigned to the variable soldier in commandSoldier
            commandSoldier(friend)
        elif friend.type == "archer":
            #commandArcher(friend)
            commandArcher(friend)
            pass

First of all before anything @Doom U must format your code according to the FAQ!!
Put 3 backticks before and after the the code, like so:

code


FYI: I forgot to put the backticks at the end because it is not working.
Here is a link to the FAQ if u need it:

how am I supposed to do that please

Like I said @Doom you have to put 3 backticks before and after your code and backticks are these:

Keep your archers back while summoning soldiers to attack.
def pickUpCoin():
# Collect coins.
items = self.findItems()
nearestCoin = self.findNearest(items)
if nearestCoin:
self.move(nearestCoin.pos)
pass
def summonTroops():
# Summon soldiers if you have the gold.
if self.costOf("soldier") self.summon("soldier")
pass

This function has an argument named soldier.
Arguments are like variables.
The value of an argument is determined when the function is called.
def commandSoldier(soldier):
# Soldiers should attack enemies.
for soldier in self.findFriends():
enemy = soldier.findNearestEnemy()
if enemy:
self.command(soldier, "attack", enemy)
pass

Write a commandArcher function to tell your archers what to do!
It should take one argument that will represent the archer passed to the function when it's called.
Archers should only attack enemies who are closer than 25 meters, otherwise, stay still.
def commandarcher(archer):
enemy = archer.findNearest(archer.findenemies)
if enemy and archer.distanceto(enemy) < 25:
self.command(archer, "attack", enemy)
else:
self.command(archer, "move", archer.pos)
loop:
pickUpCoin()
summonTroops()
friends = self.findFriends()
for friend in friends:
if friend.type == "soldier":
# This friend will be assigned to the variable soldier in commandSoldier
commandSoldier(friend)
elif friend.type == "archer":
#commandArcher(friend)
commandArcher(friend)
pass

This is the best i can do

Also I will fail if i don’t get this problem solved…When I do levels that if I lose i submit in a day…It says wait a month and I’ve been waiting for 4 months

                                             PLEASE HELP

Note that the levels that you have to wait a day between each submission are not required to progress in the main campaign. In any case, it looks like you are experiencing a quite odd bug, does it really say to wait a month? Can you post a screenshot? Is your computer’s system clock adjusted correctly? Perhaps @nick can take a look at your account’s data to check if it hasn’t been corrupted.

As for your code, please try to copy it from the game’s text editor and paste it inside ``` here. The code you’ve posted above is missing indentation.

how do I do that?And please notify nick about the bug
THANK YOU

And I already did ```

I meant ```PleaseHelp

NM
I made a mistake

Can You Help?

You mean, the system clock? It depends on your computer’s operating system. There is usually a clock in a corner of your screen, you can click in the clock one or two times and it should display a calendar. Check if the calendar is displaying the correct date.

I already @-mentioned him here, so he should be able to see this thread when he has time. :wink:

If you say what you need help with, I may be able to help. :smiley:

With my code and the bug!

And There’s no clock

For the bug, all I can do is tell you to check your machine’s system clock. If it is actually an issue with your account data, you will need one of the core guys to take a look at the CodeCombat database. Nick should be able to do that when he has time if we haven’t solved the issue until then.

As for the code, can you please try posting it again between ```? The one you have posted above is missing indentation—the spaces in the beginning of the lines—which makes it extremely hard to read.