A Monte Carlo algorithm for lattice ribbons