I'm trying to return the 'x' that I have found in my loop, but it isn't working. I need some help!
public int lookForPosition()
{
boolean found = false;
while (found = false)
{
int x = Greenfoot.getRandomNumber(getWidth());
boolean different = false;
for(int i = 0; i < xPosities.length; i++)
{
if(xPosities[i] != x)
{
different = true;
break;
}
else
{
different = false;
}
}
if(different = true)
{
found = true;
}
else
{
found = false;
}
}
return x;
}

