Cockroaches are usually treated as simple creatures that react without pause, driven by instinct rather than experience. New laboratory work from Scotland suggests the picture is less fixed.