JavaScript car racing evolution

The JavaScript version was written from scratch by Rafael Matsunaga . In addition to the open source and the simultaneous arrival of all the machines in its version, it is possible to disable rendering - in this case, only physics is calculated, and evolution is several times faster. Unlike Box Car D2, the behavior of cars is not completely determined - the same machine on the same track can show slightly different results, so sometimes a new generation shows worse results than the previous one. However, the trace generated pseudo-randomly based on the string that the user can specify is always the same for the same string, so there is a chance to compete.
Genetic Cars also has slightly less initial genetic diversity — all cars have two wheels. In total, the genome of the car consists of 14 genes - much less than in Box Car 2D. 8 of them regulate the length of each vertex of the "body", and 3 on each wheel - location, size and weight.
While I was writing this article, in the background window of Chromium on the track generated on the basis of the string “habrahabr.ru” three dozen generations of cars managed to compete. The record result is 178.87 meters.