{"id":7254,"date":"2015-02-05T10:53:54","date_gmt":"2015-02-05T09:53:54","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=7254"},"modified":"2026-03-26T16:45:11","modified_gmt":"2026-03-26T20:45:11","slug":"the-game-of-life","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2015\/02\/05\/the-game-of-life\/","title":{"rendered":"The Game of Life"},"content":{"rendered":"<p>As I have <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2009\/11\/05\/palendromic-numbers\/\" target=\"_blank\" rel=\"noopener noreferrer\">written about before<\/a>, I have always been interested in numbers and mathematics. Although my formal studies of the subject have not gone beyond the courses that I needed to attend for a science degree, my fascination with the beauty of mathematics and numbers has been life long. I have found, on a number of occasions, that I encounter a simple idea or set of rules, then find that, years later, it is still easy to bring to mind. This is a contrast to my memory for many everyday things &#8211; names, phone numbers, dates &#8230; &#8211; where is am very forgetful.<\/p>\n<p>I clearly recall a visit from a friend one evening in the late 1970s &#8230;<!--more--><\/p>\n<p>I was a student at university and my friend was aware of my interest in puzzles and mathematical oddities and shared that interest himself. So he brought along a magazine article about a &#8220;game&#8221; that he had not previously encountered. The game was simply called &#8220;Life&#8221;. I would later learn that its full name: Conway&#8217;s Game of Life. It is named after its inventor, John Conway, who had come up with the idea about a decade before I heard about it.<\/p>\n<p>Like so many fascinating things, the idea of the game is incredibly simple. The game takes place in a notionally infinite square matrix of cells. At any one time, a cell is either alive or dead, so there is a clear pattern of live cells. The game takes place as a sequence of cycles, when some specific rules are applied to all the cells simultaneously, which determine their state after the cycle. These rules appertain to the 8 immediate neighbors of each cell:<\/p>\n<ul>\n<li>if a live cell has 2 or 3 live neighbors, it continues to live; otherwise it dies<\/li>\n<li>if a dead cell has exactly 3 live neighbors, it comes alive; otherwise it remains dead<\/li>\n<\/ul>\n<p>That is it.<\/p>\n<p>To play the game, you simply define a starting pattern and start running the cycles. Most smaller patterns die out after a few cycles or reach a fully stable state &#8211; either fixed or alternating between 2 states. Here is an example, which reached a stable [alternating] state after 9 cycles:<\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0146.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-thumbnail wp-image-7255 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0146-150x150.png\" alt=\"IMG_0146\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0147.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-thumbnail wp-image-7256 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0147-150x150.png\" alt=\"IMG_0147\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0148.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7257\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0148-150x150.png\" alt=\"IMG_0148\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0149.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7258\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0149-150x150.png\" alt=\"IMG_0149\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0150.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7259\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0150-150x150.png\" alt=\"IMG_0150\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0151.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7260\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0151-150x150.png\" alt=\"IMG_0151\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0152.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7261\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0152-150x150.png\" alt=\"IMG_0152\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0153.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7262\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0153-150x150.png\" alt=\"IMG_0153\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0154.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7263\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0154-150x150.png\" alt=\"IMG_0154\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0155.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7264\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0155-150x150.png\" alt=\"IMG_0155\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0156.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7265\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0156-150x150.png\" alt=\"IMG_0156\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0155.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-7264\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/02\/IMG_0155-150x150.png\" alt=\"IMG_0155\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p>The game gets really interesting when patterns behave in more complex ways. My example above is curious, IMHO, as it starts off asymmetric, then acquires symmetry in each dimension after a couple of cycles; later it becomes fully symmetric. Other patterns do many odd things. Perhaps they disassemble and reappear a few cells across the matrix. In some extreme cases, small shapes are ejected periodically from a larger one.<\/p>\n<p>When my friend and I started out playing the game, we just used squared paper and ran the rules &#8220;by hand&#8221;. I soon realized that I could apply my hobby to the problem and write a computer program to do the work for us. And that is what I did. It was written in Fortran and ran on a DEC PDP11\/03, which was the only computer that I had access to with a VDU screen. My &#8220;universe&#8221; was 80 cells horizontally and 25 vertically. Anybody with a long memory, who used one of the VT series terminals may be able to guess why I had this size.<\/p>\n<p>Nowadays I have one of the numerous Life apps on my iPad and I still find it fascinating as these simple rules sometimes produce such a complex and unpredictable result &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I have written about before, I have always been interested in numbers and mathematics. Although my formal studies of&#8230;<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[302],"industry":[],"product":[],"coauthors":[],"class_list":["post-7254","post","type-post","status-publish","format-standard","hentry","category-news","tag-off-topic"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=7254"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7254\/revisions"}],"predecessor-version":[{"id":10336,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7254\/revisions\/10336"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=7254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=7254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=7254"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=7254"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=7254"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=7254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}