Building computationally capable biological systems has long been an aim of synthetic biology. The potential utility of bio-computing devices ranges from biosafety and environmental applications to diagnosis and personalised medicine. Here we present work on the design of bacterial computers which use spatial patterning to process information. A computer is composed of a number of bacterial colonies which, inspired by patterning in embryo development, communicate using diffusible morphogen-like signals. A computation is programmed into the overall physical arrangement of the system by arranging colonies such that the resulting diffusion field encodes the desired function, and the output is represented in the spatial pattern displayed by the colonies. We first mathematically demonstrate the simple digital logic capability of single bacterial colonies and show how additional structure is required to build complex functions. Secondly, inspired by electronic design automation, an algorithm for designing optimal spatial circuits computing two-level digital logic functions is presented, extending the capability of our system to complex digital functions without significantly increasing the biological complexity. We implement experimentally a proof-of-principle system using engineered Escherichia coli interpreting diffusion fields formed from droplets of an inducer molecule. Our approach will open up new ways to perform biological computation, with applications in synthetic biology, bioengineering and biosensing. Ultimately, these computational bacterial communities will help us explore information processing in natural biological systems.