{"id":644,"date":"2012-10-12T18:32:43","date_gmt":"2012-10-12T18:32:43","guid":{"rendered":"http:\/\/psyphi.net\/blog\/?p=644"},"modified":"2012-10-16T13:57:13","modified_gmt":"2012-10-16T13:57:13","slug":"conways-game-of-life-in-perl","status":"publish","type":"post","link":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/","title":{"rendered":"Conway&#8217;s Game of Life in Perl"},"content":{"rendered":"<p>I wanted a quick implementation of <a href=\"http:\/\/www.math.com\/students\/wonders\/life\/life.html\" title=\"Conway's Game of Life\" target=\"_blank\">Conway&#8217;s Game of Life<\/a> this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It&#8217;s not the fastest implementation on the planet but that&#8217;s most likely just the way I&#8217;ve coded it.<\/p>\n<p>Throw some 1s and 0s in the DATA block at the end to modify the start state, change the $WIDTH and $HEIGHT of the area, or uncomment the random data line in init() and see what you see.<\/p>\n<pre><code>#!\/usr\/local\/bin\/perl\r\n# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*-\r\n# vim:ts=8:sw=2:et:sta:sts=2\r\n#########\r\n# Author:        rmp\r\n# Created:       2012-10-12\r\n# Last Modified: $Date: 2012-10-12 19:09:00 +0100 (Fri, 12 Oct 2012) $\r\n# Id:            $Id$\r\n# $HeadURL$\r\n#\r\nuse strict;\r\nuse warnings;\r\nuse Time::HiRes qw(sleep);\r\nuse Readonly;\r\nuse English qw(-no_match_vars);\r\nuse Carp;\r\n\r\nReadonly::Scalar my $WIDTH      =&gt; 78;\r\nReadonly::Scalar my $HEIGHT     =&gt; 21;\r\nReadonly::Scalar my $TURN_DELAY =&gt; 0.1;\r\n\r\nour $VERSION = '0.01';\r\n\r\nmy $grid  = init();\r\nmy $turns = 0;\r\nwhile(1) {\r\n  render($grid);\r\n  $grid = turn($grid);\r\n  sleep $TURN_DELAY;\r\n  $turns++;\r\n}\r\n\r\nsub init {\r\n  #########\r\n  # initialise with a manual input from the DATA block below\r\n  #\r\n  local $RS = undef;\r\n  my $data  = &lt;data&gt;;\r\n  my $out   = [\r\n\t       map { [split \/\/smx, $_] }\r\n\t       map { split \/\\n\/smx, $_ }\r\n\t       $data\r\n\t      ];\r\n\r\n  #########\r\n  # fill the matrix with space\r\n  #\r\n  for my $y (0..$HEIGHT-1) {\r\n    for my $x (0..$WIDTH-1) {\r\n      $out-&gt;[$y]-&gt;[$x] ||= 0;\r\n#      $out-&gt;[$y]-&gt;[$x] = rand &gt;= 0.2 ? 0 : 1; # initialise with some random data\r\n    }\r\n  }\r\n  return $out;\r\n}\r\n\r\n#########\r\n# draw to stdout\/screen\r\n#\r\nsub render {\r\n  my ($in) = @_;\r\n  system $OSNAME eq 'MSWin32' ? 'cls' : 'clear';\r\n\r\n  print q[+], q[-]x$WIDTH, \"+\\n\" or croak qq[Error printing: $ERRNO];\r\n  for my $y (@{$in}) {\r\n    print q[|] or croak qq[Error printing: $ERRNO];\r\n    print map { $_ ? q[O] : q[ ] } @{$y} or croak qq[Error printing: $ERRNO];\r\n    print \"|\\r\\n\" or croak qq[Error printing: $ERRNO];\r\n  }\r\n  print q[+], q[-]x$WIDTH, \"+\\n\" or croak qq[Error printing: $ERRNO];\r\n\r\n  return 1;\r\n}\r\n\r\n#########\r\n# the fundamental Game of Life rules\r\n#\r\nsub turn {\r\n  my ($in) = @_;\r\n  my $out  = [];\r\n\r\n  for my $y (0..$HEIGHT-1) {\r\n    for my $x (0..$WIDTH-1) {\r\n      my $topedge    = $y-1;\r\n      my $bottomedge = $y+1;\r\n      my $leftedge   = $x-1;\r\n      my $rightedge  = $x+1;\r\n\r\n      my $checks = [\r\n\t\t    grep { $_-&gt;[0] &gt;= 0 &amp;&amp; $_-&gt;[0] &lt; $HEIGHT } # Y boundary checking\r\n\t\t    grep { $_-&gt;[1] &gt;= 0 &amp;&amp; $_-&gt;[1] &lt; $WIDTH }  # X boundary checking\r\n\t\t    [$topedge,    $leftedge],\r\n\t\t    [$topedge,    $x],\r\n\t\t    [$topedge,    $rightedge],\r\n\t\t    [$y,          $leftedge],\r\n\t\t    [$y,          $rightedge],\r\n\t\t    [$bottomedge, $leftedge],\r\n\t\t    [$bottomedge, $x],\r\n\t\t    [$bottomedge, $rightedge],\r\n\t\t   ];\r\n\r\n      my $alive = scalar\r\n\t          grep { $_ }\r\n\t          map { $in-&gt;[$_-&gt;[0]]-&gt;[$_-&gt;[1]] }\r\n\t\t  @{$checks};\r\n\r\n      $out-&gt;[$y]-&gt;[$x] = (($in-&gt;[$y]-&gt;[$x] &amp;&amp; $alive == 2) ||\r\n\t\t\t  $alive == 3);\r\n    }\r\n  }\r\n  return $out;\r\n}\r\n\r\n__DATA__\r\n0\r\n0\r\n0\r\n0\r\n0\r\n0\r\n0000000010\r\n0000000111\r\n0000000101\r\n0000000111\r\n0000000010\r\n&lt;\/data&gt;<\/code><\/pre>\n<p>p.s. WordPress is merrily swapping &#8220;DATA&#8221; for &#8220;data&#8221; on line 38 and adding an extra \/data tag at the end of that code snippet. Fix line 38 and don&#8217;t copy &#038; paste the close tag. Damn I hate WordPress :(<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted a quick implementation of Conway&#8217;s Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It&#8217;s not the fastest implementation on the planet but that&#8217;s most likely just the way I&#8217;ve coded it. Throw some 1s &hellip; <a href=\"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Conway&#8217;s Game of Life in Perl&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":652,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[11],"tags":[825,824,198,809,21],"class_list":["post-644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-commandline","tag-conway","tag-fun","tag-life","tag-perl"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"I wanted a quick implementation of Conway&#039;s Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It&#039;s not the fastest implementation on the planet but that&#039;s most likely just the way I&#039;ve coded it. Throw some 1s\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Roger Pettett\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"psyphi.net blog - Another collection of braingunk and technolint\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Conway\u2019s Game of Life in Perl - psyphi.net blog\" \/>\n\t\t<meta property=\"og:description\" content=\"I wanted a quick implementation of Conway&#039;s Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It&#039;s not the fastest implementation on the planet but that&#039;s most likely just the way I&#039;ve coded it. Throw some 1s\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-10-12T18:32:43+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2012-10-16T13:57:13+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Conway\u2019s Game of Life in Perl - psyphi.net blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I wanted a quick implementation of Conway&#039;s Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It&#039;s not the fastest implementation on the planet but that&#039;s most likely just the way I&#039;ve coded it. Throw some 1s\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#blogposting\",\"name\":\"Conway\\u2019s Game of Life in Perl - psyphi.net blog\",\"headline\":\"Conway&#8217;s Game of Life in Perl\",\"author\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/psyphi.net\\\/wp-uploads\\\/2012\\\/10\\\/screenshot-e1350069813818.png\",\"width\":205,\"height\":259},\"datePublished\":\"2012-10-12T18:32:43+00:00\",\"dateModified\":\"2012-10-16T13:57:13+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#webpage\"},\"articleSection\":\"programming, commandline, conway, fun, life, perl\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/psyphi.net\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"name\":\"programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"position\":2,\"name\":\"programming\",\"item\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#listItem\",\"name\":\"Conway&#8217;s Game of Life in Perl\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#listItem\",\"position\":3,\"name\":\"Conway&#8217;s Game of Life in Perl\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"name\":\"programming\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\",\"name\":\"psyphi.net blog\",\"description\":\"Another collection of braingunk and technolint\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/\",\"name\":\"Roger Pettett\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f715f8335258578c567eb8c22335f1cee22c971c2aff8be27c4d8d934c436503?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Roger Pettett\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#webpage\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/\",\"name\":\"Conway\\u2019s Game of Life in Perl - psyphi.net blog\",\"description\":\"I wanted a quick implementation of Conway's Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \\\/ on the commandline. It's not the fastest implementation on the planet but that's most likely just the way I've coded it. Throw some 1s\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/psyphi.net\\\/wp-uploads\\\/2012\\\/10\\\/screenshot-e1350069813818.png\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#mainImage\",\"width\":205,\"height\":259},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2012\\\/10\\\/conways-game-of-life-in-perl\\\/#mainImage\"},\"datePublished\":\"2012-10-12T18:32:43+00:00\",\"dateModified\":\"2012-10-16T13:57:13+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/\",\"name\":\"psyphi.net blog\",\"description\":\"Another collection of braingunk and technolint\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Conway\u2019s Game of Life in Perl - psyphi.net blog","description":"I wanted a quick implementation of Conway's Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It's not the fastest implementation on the planet but that's most likely just the way I've coded it. Throw some 1s","canonical_url":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#blogposting","name":"Conway\u2019s Game of Life in Perl - psyphi.net blog","headline":"Conway&#8217;s Game of Life in Perl","author":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"publisher":{"@id":"https:\/\/psyphi.net\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/psyphi.net\/wp-uploads\/2012\/10\/screenshot-e1350069813818.png","width":205,"height":259},"datePublished":"2012-10-12T18:32:43+00:00","dateModified":"2012-10-16T13:57:13+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#webpage"},"isPartOf":{"@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#webpage"},"articleSection":"programming, commandline, conway, fun, life, perl"},{"@type":"BreadcrumbList","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog#listItem","position":1,"name":"Home","item":"https:\/\/psyphi.net\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","name":"programming"}},{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","position":2,"name":"programming","item":"https:\/\/psyphi.net\/blog\/category\/programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#listItem","name":"Conway&#8217;s Game of Life in Perl"},"previousItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#listItem","position":3,"name":"Conway&#8217;s Game of Life in Perl","previousItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","name":"programming"}}]},{"@type":"Organization","@id":"https:\/\/psyphi.net\/blog\/#organization","name":"psyphi.net blog","description":"Another collection of braingunk and technolint","url":"https:\/\/psyphi.net\/blog\/"},{"@type":"Person","@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author","url":"https:\/\/psyphi.net\/blog\/author\/rmp\/","name":"Roger Pettett","image":{"@type":"ImageObject","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/f715f8335258578c567eb8c22335f1cee22c971c2aff8be27c4d8d934c436503?s=96&d=mm&r=g","width":96,"height":96,"caption":"Roger Pettett"}},{"@type":"WebPage","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#webpage","url":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/","name":"Conway\u2019s Game of Life in Perl - psyphi.net blog","description":"I wanted a quick implementation of Conway's Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It's not the fastest implementation on the planet but that's most likely just the way I've coded it. Throw some 1s","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/psyphi.net\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#breadcrumblist"},"author":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"creator":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/psyphi.net\/wp-uploads\/2012\/10\/screenshot-e1350069813818.png","@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#mainImage","width":205,"height":259},"primaryImageOfPage":{"@id":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/#mainImage"},"datePublished":"2012-10-12T18:32:43+00:00","dateModified":"2012-10-16T13:57:13+00:00"},{"@type":"WebSite","@id":"https:\/\/psyphi.net\/blog\/#website","url":"https:\/\/psyphi.net\/blog\/","name":"psyphi.net blog","description":"Another collection of braingunk and technolint","inLanguage":"en-US","publisher":{"@id":"https:\/\/psyphi.net\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"psyphi.net blog - Another collection of braingunk and technolint","og:type":"article","og:title":"Conway\u2019s Game of Life in Perl - psyphi.net blog","og:description":"I wanted a quick implementation of Conway's Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It's not the fastest implementation on the planet but that's most likely just the way I've coded it. Throw some 1s","og:url":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/","article:published_time":"2012-10-12T18:32:43+00:00","article:modified_time":"2012-10-16T13:57:13+00:00","twitter:card":"summary_large_image","twitter:title":"Conway\u2019s Game of Life in Perl - psyphi.net blog","twitter:description":"I wanted a quick implementation of Conway's Game of Life this evening to muck about with, with the boys. Whipped this up in simple Perl for running in a terminal \/ on the commandline. It's not the fastest implementation on the planet but that's most likely just the way I've coded it. Throw some 1s"},"aioseo_meta_data":{"post_id":"644","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-05-16 16:00:01","updated":"2025-08-15 17:30:53","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/psyphi.net\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/psyphi.net\/blog\/category\/programming\/\" title=\"programming\">programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tConway\u2019s Game of Life in Perl\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/psyphi.net\/blog"},{"label":"programming","link":"https:\/\/psyphi.net\/blog\/category\/programming\/"},{"label":"Conway&#8217;s Game of Life in Perl","link":"https:\/\/psyphi.net\/blog\/2012\/10\/conways-game-of-life-in-perl\/"}],"_links":{"self":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/comments?post=644"}],"version-history":[{"count":9,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions"}],"predecessor-version":[{"id":650,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions\/650"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/media\/652"}],"wp:attachment":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}