Hey guys, I have an ant that moves throughout a Lawn world.
The ant always starts facing east.
It moves by moving one space forward then taking a random turn using:
public void randomTurn()
{
boolean andy = Random.generator().nextBoolean();
if (andy)
{
this.turn(90); }
else
{
this.turn(-90) }
}
Now when I go to test it, I have:
public void testAct()
{
beach = new Beach(1);
beach.addTurtle();
Turtle.act();
}
I'm not sure which assertions to put. I want to test if my ant turned right or left, but since it's random, I won't know which happened.
Thoughts?
