The present work addresses for the first time the simulation of the evolution of an elemental eye by means of a simple genetic algorithm. The problem of the gradual evolution of a structure as complex as the eye was raised by Darwin, being still at the beginning of the 21st century a source of controversy between creationists and evolutionists. Taking as a starting point the paper of Nilsson and Pelger and their hypothesis that the evolution of the eye can be studied if we limit ourselves to its optical geometry, we show how eye evolution could take place gradually applying the principle of natural selection. Our model is limited to studying how an array of photosensitive epithelial cells is bent gradually to achieve a camera obscura