Oh, right. It would be so much better if appropriately defined directional constants were used instead of true/false, like FORWARD/REVERSE. Those are the first things I do now in my own code, so I don't have much practice in reading puzzles.
How can I program my autonomous arduino car to drive for a defined distance, for example 10cm ?
I am not using any position sensor.
You can't.
Without any feedback, you are simply guessing how long to wait while the motors ramp up, the car to move some distance, and the motors to ramp back down and the car to stop.
Change the surface you run the car on while you carefully measure how far it moves in some defined amount of time, the the car will have traveled a different distance in the same amount of time.
As the batteries loose charge, the time will change. It is a fool's errand to try to program a car to move an exact distance in a given amount of time without any feedback.
Even using feedback on the wheels doesn't give exact distances because the wheels slip a different amount on different surfaces, even when you're not skidding or spinning the wheels.