I recall a novel in the mid-'80s about a (high school or college) student assigned to write simulation code. He develops a virtual world in which the inhabitants use time travel to bring natural resources from the past to the present. However, the simulations inevitably fail because overuse of this method results in a barren early Earth that could not initially support life.
At some point, the student realizes that his time-travel equations aren't just hand-wavy but valid in the real world and that the same resource-stripping and resulting consequences might occur in reality. The third act involves escaping from government agencies trying to obtain the simulation code.
Anyone remember this?