Algorithm

JavaAntz

To write a computer program, you have to tell the computer, step by step, exactly what you want it to do. The computer then “executes” the program, following each step mechanically, to accomplish the end goal.

When you are telling the computer what to do, you also get to choose how it’s going to do it. That’s where computer algorithms come in. The algorithm is the basic technique used to get the job done.

JavaAntz:

Why did I make this?
It’s because I’m fascinated with “Boid” algorithms which seek to simulate life’s complex patterns with simple algorithms and rules.

The Ant Rules
(1) If you don’t know where breadcrumbs are, try to find some.
(2) If you see another ant, ask if they know where bread crumbs are. If they know, head toward them. If not, run away from that ant (because afterall, food probably isn’t nearthem if they don’t know where food is.)
(3) If you find bread crumbs, takeit back to the hole, and return to the place where you found food (because where there is food, there is probably more food.) If you don’t find any crumbs where you thought they were supposed to be, start searching again (and tell other ants there is no food there).

Did you like this? Share it:
This entry was posted in Uncategorized by Joel. Bookmark the permalink.

Leave a Reply