This is my first attempt at writting something in Erlang.
"We had to implement a simulated world inhabited by carrots, rabbits, and wolves. Rabbits would roam this world eating carrots that grew in random patches. When they had eaten enough carrots, the rabbits would get fat and split in two. Wolves ran around eating up the rabbits; if they managed to catch and eat enough rabbits, they would also get fat and split. Rabbits and wolves within a certain distance of each other would broadcast information on food and predators. If a rabbit found a carrot patch, other rabbits would quickly join him. If a wolf found a rabbit, the pack would start chasing it."
Edit world_types.hrl and modify the world_info record (max_x and max_y are the dimensions of the world):
-record(world_info, {carrots=60,rabbits=15,wolves=5,max_x=15,max_y=15}).
Compile (requires Erlang):
erlc *.erl
Launch Erlang runtime:
erl
Start your own world:
application:start(world).
- Graphical interface