I have recently been reading about serendipitous discoveries in science and I found them quite inspiring. Most of those discoveries are in Chemistry. I'm looking for examples of these kinds of discoveries in Mathematics and Computer Science.
Examples of serendipitous discoveries include the discoveries of penicillin, saccharine and superglue.
Poincare's accidental discovery of Chaos Theory qualifies.
I am looking for the element of surprise and accident. A wonderful proof which consists of an extremely enlightened step does not qualify because the person was still searching for a proof. But, if a person was working in area X and suddenly realized that it's a way of solving Y, then that discovery would qualify.
Note : There is a question on this already on the site. My question is different for two reasons. Firstly, I'm not asking for important discoveries. Secondly, I'm not asking for recency either. Any discovery in the history of Mathematics qualifies.