It is currently Fri Nov 24, 2017 4:44 pm Advanced search

Tutorial Step 2: gathering food

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Tutorial Step 2: gathering food

Postby bazinga » Fri Aug 24, 2012 11:15 am

Hello guys,
I'm totally new to this and I'm pretty clueless ;)

I know it sounds really dumb, but I have problems with the tutorial. In step two, after adding the do_move_location function, I don't know what the "default move" is. I'm supposed to replace it with this:
# find close food
ant_dist = []
for food_loc in ants.food():
for ant_loc in ants.my_ants():
dist = ants.distance(ant_loc, food_loc)
ant_dist.append((dist, ant_loc, food_loc))
ant_dist.sort()
for dist, ant_loc, food_loc in ant_dist:
if food_loc not in targets and ant_loc not in targets.values():
do_move_location(ant_loc, food_loc)
and I tried it several times, but the ants behave different from the example in the tutorial.

Please help me...

yours, bazinga
bazinga
Cadet
 
Posts: 1
Joined: Fri Aug 24, 2012 11:06 am

Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 2 guests

cron