for (int x = 0; x < 20; x++); //repeat 20 times
Same problem as with the if statement. The ; forms the body of the for loop. Do nothing twenty times. That certainly won't take long.
for (int j = 0; j < 900; j--); //amount of maximum space i can travel
for (int x = 20; x > 0; x--); //repeat 20 times
Ditto.
{
for (int j = 0; j < 900; j--); //amount of maximum space i can travel
}
What are the curly braces for?