I suggest to look at bot moves as objects (I have no java environment now, so fix the syntax) :
You should define the class like
class SingleMove
{
public SingleMove(boolean short, boolean left)
{
Short = short;
Left = left;
}
public boolean Short;
public boolean Left;
}
public void Move()
{
if (Short)
{
forwardShort();
}
else
{
forwardLong();
}
if (Left)
{
Drive.toTheLeft();
}
else
{
Drive.toTheRight();
}
}
}
Than you can create array with preferred algorithm of movement:
ArrayList [] Allmoves = new Arralylist;
Allmoves.Add(new SingleMove(True, False));
...
Allmoves.Add(new SingleMove(True, False));
Allmoves.Add(new SingleMove(False, False));
Then your action code will be like :
for(int ii = 0 ; ii < Allmoves.GetLenght(); ii++)
{
if(!Detect.obstacle(5))
{
Allmoves[ii].Move();
}
}