Issue with Mountain Car simulation

Hi! It seems the calculation is not stopping. Can you please check the code at https://ide.codingblocks.com/s/311246