elseif(cpuHorizontal==false&&y+lengthCPU<=10)// checks are the same as above swapping out the user input isShiftDown for a variable to determine the same
{
potentialLegalSpace=true;
}
if(potentialLegalSpace==true)
{
for(intk=0;k<lengthCPU;k++)
{
if(cpuHorizontal==true)
{
if(cpuBoard[x+k][y]==0)
{
legalSpaceCount++;
}
}
else
{
if(cpuBoard[x][y+k]==0)
{
legalSpaceCount++;
}
}
}
if(legalSpaceCount==lengthCPU)
{
legalSpace=true;
}
//validation complete, last thing is to create the coms ships
//validation complete, last thing is to create the coms ships
if(legalSpace==true)
if(legalSpace==true)
...
@@ -352,7 +345,9 @@ public class Main extends Application{
...
@@ -352,7 +345,9 @@ public class Main extends Application{