I'm going to admit- yes this is for school- but no I'm not asking for anyone to do this for me, I just need some help as I am lost completely. The assignment was to use StdDraw to create a 1000 by 1000 canvas, and then load 300 plants on to the canvas and 20 herbivores on to the canvas. We were supposed to create a plant class and an herbivore class. A plant was a simple black circle, with a radius of 1 meter (1
unit of the canvas). They don't move but they are generated with random locations. Herbivores are similar, but they are a circle with a radius of 5 meters and they move- each individual Herbivore was only able to see in a 50 meter radius around itself, and IF there were any plants in that 50 m radius, it was supposed to slowly move towards the nearest one (not in a straight line, we haven't learned that yet, but like to the left/right then up/down) and once it had reached the plant the Herbivore would eat the plant and the plant would dissapear. If there ARENT any plants in the 50m radius outside of a herbivore, the herbivore should move in a random direction until there is a plant within 50 m around the herbivore. Then, it should do the same thing and eat it. This would continue until all of the plants were gone, at which point the simulation would end and the console would print out a report of how many plants each herbivore had eaten. I managed to get a good deal of it done- I made it so the plants could randomly generate and so the herbivores generated, but I can't seem to make them move correctly. Please take a look at my code, and if you have any ideas please advise. I'm totally lost.
Code is here:
https://gist.github.com/anonymous/ff7c83e67c4570dae20d