Arduino behaves non-deterministic?

run exact the same code and get different results,

And post a circuit diagram of eactly how you have powered and connected the motors, shield and UNO.

Pete