We present a new numerical code for spherical hydrodynamics in general
relativity. The code can handle gravitational collapse to a neutron s
tar or to a black hole without the appearance of singularities. Moreov
er, the variables and equations in the code are very similar to those
appearing in traditional Lagrangian supernova codes. Any such existing
code can thus be easily adapted to treat collapse where the final fat
e is uncertain and may be either a neutron star or a black hole. The c
ode is based on the formulation of Hernandez & Misner, in which retard
ed time is used as a coordinate. This prevents the computational grid
from penetrating inside any black hole that may form. We present the e
quations and a complete finite difference scheme for the adiabatic evo
lution of a fluid that obeys a gamma-law equation of state. We summari
ze the results of several testbed calculations performed to check our
code. We also give the transformation of the analytic Oppenheimer-Snyd
er solution for homogeneous dust collapse to our coordinate system.