I have four almost same loops in Java with different methods:
int Point;
for (int i = 0; i < 10; i++)
{
if (isLeft())
Point = i;
}
for (int i = 0; i < 10; i++)
{
if (isRight())
Point = i;
}
for (int i = 0; i < 10; i++)
{
if (isAbove())
Point = i;
}
for (int i = 0; i < 10; i++)
{
if (isUnder())
Point = i;
}
Can I merge all loops to one?
Aucun commentaire:
Enregistrer un commentaire