There are two sorts of "spiders" (X and Y) living on an island. Spiders are metal robots and they consume metal. Spider can eat another spiders but only those of another sort.
Sunshine is the source of energy for spiders.
Y-spiders have accumulators that are recharging during the day. Y-spiders can move during the day and also during the night but are slower than X-spiders.
X-spiders have no accumulators thus they can not move during the night. They are faster than Y-spiders during the day.
Spiders consume all metal food in their way.
Direction of move of spiders is randomly changed after collision of two spiders of the same sort, after bumping into a wall and after reaching water.
X-spider wins fight with Y-spider with adjustable probability during the day. Y-spider wins fight with X-spider with adjustable probability during the night. The winner always eats beaten spider.
Spider will reproduce itself when he reaches double of its initial weight. In such case from the spider will be detached a new spider whose weight will be one unit.
Create a programm which will simulate life of spiders on the island and meets following criteria: