In this article we study a one dimensional model for a polymer in a poor solvent, that is the random walk on $\ZZ$ penalized by its range. More precisely, we consider a Gibbs transformation of the law of the simple symmetric random walk by a weight $\exp(-h_n |\mathcal{R}_n|)$, with $|\mathcal{R}_n|$ the number of visited sites and $h_n$ a size-dependent positive parameter. We use gambler’s ruin estimates to obtain exact asymptotics for the partition function, that enables us to obtain a precise description of trajectories, in particular scaling limits for the center and the amplitude of the range. A phase transition for the fluctuations around an optimal amplitude is identified at $h_n \asymp n^{1/4}$, inherent to the underlying lattice structure.