This paper presents a shape and topology optimization scheme for structures by using the concept of a cellular automaton (CA). A design domain domain is divided into small square cells and then the thicknesses of the individual cells are taken as the design variables. Considering the cells as the finite elements, the stress analysis is performed by the finite element method. The design variables are modified by applying a local rule to the stress states of the cell and its neighbouring cells. The present scheme is applied to a two-dimensional elastic problem in order to confirm its validity.