{"id":15501441,"url":"https://github.com/rickhull/conway_deathmatch","last_synced_at":"2025-04-22T22:24:39.727Z","repository":{"id":23691126,"uuid":"27062965","full_name":"rickhull/conway_deathmatch","owner":"rickhull","description":"Game of Life: several competing populations","archived":false,"fork":false,"pushed_at":"2023-02-02T19:48:02.000Z","size":177,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T19:55:08.915Z","etag":null,"topics":["conway","conway-game","conway-life","deathmatch","elixir","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rickhull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-24T05:58:15.000Z","updated_at":"2023-11-02T02:17:13.000Z","dependencies_parsed_at":"2023-02-10T12:16:38.884Z","dependency_job_id":null,"html_url":"https://github.com/rickhull/conway_deathmatch","commit_stats":{"total_commits":266,"total_committers":2,"mean_commits":133.0,"dds":"0.018796992481203034","last_synced_commit":"7d869d796438704298b0be4ba30013dad4ccbccc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickhull%2Fconway_deathmatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickhull%2Fconway_deathmatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickhull%2Fconway_deathmatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickhull%2Fconway_deathmatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickhull","download_url":"https://codeload.github.com/rickhull/conway_deathmatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250332761,"owners_count":21413264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conway","conway-game","conway-life","deathmatch","elixir","ruby"],"created_at":"2024-10-02T09:04:22.450Z","updated_at":"2025-04-22T22:24:39.681Z","avatar_url":"https://github.com/rickhull.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI Status](https://github.com/rickhull/conway_deathmatch/actions/workflows/ci.yaml/badge.svg)](https://github.com/rickhull/conway_deathmatch/actions/workflows/ci.yaml)\n[![Gem Version](https://badge.fury.io/rb/conway_deathmatch.svg)](http://badge.fury.io/rb/conway_deathmatch)\n\nIntroduction\n===\n\n[Conway's Game of Life](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life)\nis a small, simple set of rules for\n[cellular automata](http://en.wikipedia.org/wiki/Cellular_automaton).\nOperating like a simulation, there is a starting state where certain points on\na 2 dimensional board are populated, and the rules of the game determine the\nnext state, generating interesting, unpredictable, and ultimately lifelike\npatterns over time.\n\nRules\n---\nCells die or stay dead, unless:\n* Birth rule: 3 neighboring cells turn dead to alive\n* Survival rule: 2 or 3 neighboring cells prevent a live cell from dying\n\nOn \"Deathmatch\"\n---\nThe traditional set of rules tracks a single population, even though it may\nform several distinct islands and disjointed groups.  For this project,\n*deathmatch* refers to multiple populations with respective identities over\ntime (e.g. red vs blue).\n\nDeathmatch Rules\n---\nChoose:\n* Defensive: Alive cells never switch sides\n  - This is the rule followed by the *Immigration* variant of CGoL, I believe\n* Aggressive: Alive cells survive with majority\n  - 3 neighbors: clear majority (e.g. 2 red, 1 blue)\n  - 2 neighbors: coin flip (e.g. 1 red, 1 blue)\n* Friendly: Just count friendlies\n  - Enemies don't count, party on! (e.g. 3 red, 2 blue)\n\nUsage\n===\n\nRequirements\n---\n\n* Ruby 2.0 or newer (`__dir__` is used in the gemspec and for shape loading)\n\n\nInstall\n---\n\n    gem install conway_deathmatch\n\nDemo\n---\n\n    # defaults to 70x40 board and an acorn shape\n    conway_deathmatch\n\n    # deathmatch triggered by several populations\n    conway_deathmatch --one \"acorn 30 30\" --two \"diehard 20 10\"\n\nAvailable Shapes\n---\n\nA shape is simply a set of points.  Classic shapes are [defined in a yaml file](https://github.com/rickhull/conway_deathmatch/blob/master/lib/conway_deathmatch/shapes/classic.yaml):\n\n* acorn\n* beacon\n* beehive\n* blinker\n* block\n* block_engine_count (block engine, minimal point count)\n* block_engine_space (block engine, minimal footprint)\n* block_engine_stripe (block engine, 1 point tall)\n* boat\n* diehard\n* glider\n* loaf\n* lwss (lightweight spaceship)\n* rpent (R-pentomino)\n* swastika\n* toad\n\nThere is [another yaml file](https://github.com/rickhull/conway_deathmatch/blob/master/lib/conway_deathmatch/shapes/discovered.yaml) with shapes discovered via [proving_ground](https://github.com/rickhull/conway_deathmatch/blob/master/bin/proving_ground).\n\n\nImplementation\n===\n\nJust one file, aside from shape loading: [Have a look-see](https://github.com/rickhull/conway_deathmatch/blob/master/lib/conway_deathmatch.rb)\n\nBoundaries are toroidal, meaning that cells \"wrap\" at the edges, such that the left edge is adjacent to the right edge, and likewise with top and bottom. Thus, the grid has the topography of a torus (i.e. doughnut).\n\nInspiration\n---\nThis project was inspired by http://gameoflifetotalwar.com/ (hereafter CGOLTW).\nYou should check it out.  It updates the classic set of rules, which support\nonly a single population, for multiple populations which are able to compete\nfor space and population.\n\nThis project exists not to compete with CGOLTW but as a supplementary\nproject for exploration and learning.  My initial motivation was to make a\n\"[proving ground](https://github.com/rickhull/conway_deathmatch/blob/master/bin/proving_ground)\" for searching for simple shapes and patterns with high birth\nrates for determining successful CGOLTW strategies.\n\nComing into this project, I had significant background knowledge concerning\nConway's Game of Life, but I could not have recited the basic rules in any\nform. After being inspired by competing in CGOLTW, I read their [one background\npage](http://gameoflifetotalwar.com/how-to-play) and then the\n[wikipedia page](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).  I\ndeliberately avoided any knowledge of any other implementations,\nconsidering this project's implementation as of December 5 (2014) to be the\nnaive, simple approach.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickhull%2Fconway_deathmatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickhull%2Fconway_deathmatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickhull%2Fconway_deathmatch/lists"}