Game of life written in JavaScript