stepRoad = () => {
const row = theMap.children[0].cloneNode(true)
const first = row.children[0]
const firstClass = first.getAttribute("class")
const last = row.children[row.children.length-1]
const lastClass = last.getAttribute("class")
switch ( dRoad() ) {
case 0: break;
case 1: if ( lastClass=="offroad") { row.prepend(last) } else { row.appendChild(first) } break;
case -1: if (firstClass=="offroad") { row.appendChild(first) } else { row.prepend(last) } break;
}
theMap.children[theMap.children.length-1].remove()
theMap.prepend(row)
theCar.move()
drawCar()
}