Most languages come with a built-in to search a string for all occurrences of a given substring and replace those with another. I don't know of any language that generalises this concept to (not necessarily contiguous) subsequences. So that's your task in this challenge.
The input will consist o...
I added Earth and its orbit was normal. Then I added Mars, which shot out into space and also caused Earth's orbit to be super close to the sun half the time and super far away the other half >_>
This time I got two planets relatively stable. Then I added one with zero initial velocity named SUNDIVE and it shot through the sun at an insanely fast speed out into space
Okay, the left orbit is smaller than the right. That means that distances between planets will change. Yet, the orbits are almost perfectly elliptical anyway.
Vex ROBOTC has the following command for displaying integers to the LCD display:
displayLCDNumber(nLine, nPos, nValue, nPrecision);
I'm trying to display the following: displayLCDNumber(0, 4, 3.14159, nPrecision);
Supposedly, using the nPrecision parameter I should be able to display floats. Un...
Hmmm. Curious. I have two earths and a jupiter in the same orbit. They never pass each other, but the earths move from approximately the trojan positions to almost directly opposite the jupiter, and back. Over a span of a few minutes. This makes me wonder whether gravity between planets is actually repulsive, not attractive.