A semidiscrete scheme for a one-dimensional Cahn-Hilliard equation