ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Online Introduction to Conway's Way of Life in Javascript

Updated on November 16, 2016
janderson99 profile image

Dr. John applies his scientific (PhD) research skills & 30 years experience as an inventor & futurist to review technology, apps, software.

Introduction

The Game of Life was invented in 1970 by John Horton Conway a British mathematician as an intriguing solitaire pastime which he called "life". It is one of several 'simulation' games or 'cellular automaton' which have been invented that have analogies with the rise, death and development of colonies of living organisms – i.e. they resemble real-life processes. Originally it was played with a large checkerboard and a heap flat counters of two colours – one for live cells and one for dead cells. In some ways it resembles the ancient Oriental game of "Go", with the concept that a cell surrounded by 4 neighbours (vertically and horizontally) dies. The game is much easier to play on a computer.

The basic idea is to start with a simple pattern of counters (organisms), one to a square on the board, then see how the pattern and distribution of cells changes as you apply Conway's list of "genetic life laws" for births, deaths and survivals. Conway spent a lot of time choosing his rules after many experiments.

The Game of Life - Rules and How to Play

Rules

The outcomes for the starting pattern or 'colony' cannot be predicted, and there are several outcomes. The colony can grow for several generations before:

  • disappearing gradually, either temporarily or permanently (from being isolated ('lonely'), too sparse or dies out through overcrowding
  • reaching a stable configuration that remains as a fixed pattern,
  • or becoming an oscillating pattern in which the colony repeats through a cycle in an endless cycle of two or more periods.

The game is now played on computers is a 'set and let go' game, meaning that its path and outcome is determined by its initial state, described as a 'seed', and no further input is require from the player. The fascination with the Game of Life lies with the creation of an initial seed configuration and seeing how it evolves and whether you can create a population that lives for ever or produces and interesting oscillating pattern or stable fixed set of colonies.

Rules

The universe of the Game of Life is a potentially infinite two-dimensional grid of squares, each of which can be live or dead. Every cell is influenced by its eight neighbours in the colony, which includes the cells that are directly adjacent either horizontally, vertically, or diagonally. At each step in time (known as a 'tick' or step of the game), the following transitions occur:

  • Survivals - Every cell with 2 or 3 neighbouring counters survives for the next generation.
  • Deaths - Each cell with 4 or more neighbours dies (disappears) from overpopulation. Every counter with 1 or zero neighbours dies from isolation (loneliness).
  • Births - Each empty or dead cell that is adjacent to exactly 3 neighbours no more or less, is a birth cell through reproduction. A live cell is added at the location the next move.

The HighLife version spawns a new cell if there are exactly 6 neighbouring cells a well as 3.

Players should note that all deaths and births occur simultaneously. The outcome of applying all the rules constitute a single generation step in the evolution of the population or colony. Because deaths and births occur simultaneously, the newborn cells have no role in leading to the retention of adjacent cells or their deaths and births in the generation in which they were created.

The initial cellular layout or pattern is described as the 'seed' for the game. The first generation of the colony is produced by applying the rules to every cell in the seed - both deaths and births occur simultaneously, and the precise time when this happens is often referred to as a 'tick'. Each generation is purely created from the one before without input from the player. The rules and calculations of neighbours continues to be applied to create further generations unless the pattern is fixed and stable or the colony dies out completely.

Players will be intrigued to see the population developing and progressing through unusual, sometimes lovely and unexpected changes with unpredictable outcomes. Sometimes the colony or population eventually dies out (all cells die), although this may not occur until after a large number generations. Most seed patterns either reach stable pattern, that Conway called 'still lifes', that don't change or patterns that oscillate forever. Seed patterns with no initial symmetry often become symmetrical after several generations. Once this happens the symmetry remains, and it may increase in richness by will not become unsymmetrical again.

Game of Life devotees have catalogued more than 600 of interesting seed patterns leading to unique and interesting populations, including:

  • Glider – set of 5 cells that moves diagonally down or up the page. The glider regenerates the start pattern in the same orientation after four generations.
  • Gun - a pattern that repeatedly shoots out a sequence of moving objects such as the "glider" or another pattern referred to as a "puffer train" (a pattern that leaves behind a trail of "smoke" particles as it moves across the board).
  • Spaceships - the glider is a "featherweight spaceship"; there are many others with lots more cells and complexity, but they all glide across the board).
  • Traffic lights blinkers - three or more cells that flash from a vertical to a horizontal position.
  • Star Patterns - oscillating patterns that resemble stars or fire-works.

Ever since its inception, Conway's Game of Life has generated huge interest and many devotees because of the fascinating way the patterns and structures appear and evolve It also provides programming challenge and life simulation modelling. The Game of Life provides an example of self-organization and emergence and is a good example of cellular automaton . It is interesting for mathematicians, physicists, philosophers, biologists, economists, population scientists and others to study the way that complex structures, patterns and oscillating forms can emerge from the application of very simple rules. The popularity of Conway's Life was increased by the widespread availability inexpensive minicomputers (PC's) which at the time became more readily available. This allowed longer and more complex seeds to be run for millions of generations.

The game was originally played as a manual board game but it was tedious and difficult to apply the rules. Computers changed this and there have been a huge number of programs developed. It has been set as a classic computer programming language for generations and information technology students. Surprisingly although there is a java applet, that can be run on a website, there have been few stand-alone website applications using Javascript.

© janderson99-HubPages

A recent application provides a simple introduction:

Since Life's original inception, various new cellular automata of the same theme have been developed. Variant HighLife, includes an extra rule that 6 neighbours, in addition to the 3 neighbours causes a birth. HighLife is best known for its frequently occurring replicators which are patterns that create series of identical colonies that replace the original colony or produce new colonies.

The new website applications provide an easy way for new user to play the game.

From a seemingly random initial pattern of living cells on the grid, players will find the on-screen population constantly changing and evolving as the generations tick by. Many beautiful patterns can be developed from the simple rules. Small isolated colonies of cells showing no initial symmetry generally become symmetrical after several generations. When this happens the symmetry remains is only lost if a nearby colony moves in and devours it. In some cases the population eventually dies out, with all living cells disappearing, but this may not occur for many generations and after the colony has passed through many stages. Most initial patterns eventually produce either stable patterns or colonies that oscillate forever between two or more states. The patterns may also produce one or more gliders or spaceships that move off away from the initial location.

It is very interesting to try the more than 600 patterns that have been invented and to try your own.

But beware you can become obsessed by the Game of Life. Enjoy!

© janderson99-HubPages

Comments

Submit a Comment

No comments yet.

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://hubpages.com/privacy-policy#gdpr

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)