Here is a simulation of the standard Twins paradox. One of the clocks is considered at rest while the other travels.
Its speed is planned to be .866c so it is already contracted at half the length of the one at rest before we hit the
start button. We can observe that the light constantly takes twice the time to make its roundtrip in the moving clock
than in the one at rest, so that it displays half the elapsed time at the end. I had to account for the late detection
of the photon by the mirrors, because the steps that represent the speed of the mirrors cannot be absolutely precise,
so I increased the speed of light to 1.0044 to compensate for the loss of time. Before doing that, the moving clock
was taking more time than expected to make its roundtrip. To find the right number, I had to change the speed and run
the simulation until the moving clock would stop as close as possible to where it started. For more details, right
click on the screen an select "Source code".