Flocking

recently, i have become quite interested in flocking, but, as i am not that great of a programmer, have not been able to write a simple flocking… thing.

the main problem i have is making it dynamic. while i could go about, having each object check out every other object, but this is slow, inneficient, and i have to know exactly how many objects there are. which is a pain.

does anyone have any ideas on this?