{"id":16125585,"url":"https://github.com/semibran/node-life","last_synced_at":"2025-10-16T17:19:44.908Z","repository":{"id":130492063,"uuid":"124355044","full_name":"semibran/node-life","owner":"semibran","description":":seedling:tiny update function for life-like cellular automata","archived":false,"fork":false,"pushed_at":"2018-04-09T21:17:18.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T18:59:21.537Z","etag":null,"topics":["cellular-automata","game-of-life","life"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semibran.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","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":"2018-03-08T07:38:59.000Z","updated_at":"2018-04-08T03:03:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fd7be97-d03a-4063-8bda-a1dfd68f63df","html_url":"https://github.com/semibran/node-life","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fnode-life","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fnode-life/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fnode-life/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fnode-life/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semibran","download_url":"https://codeload.github.com/semibran/node-life/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485291,"owners_count":20946398,"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":["cellular-automata","game-of-life","life"],"created_at":"2024-10-09T21:30:02.503Z","updated_at":"2025-10-16T17:19:39.857Z","avatar_url":"https://github.com/semibran.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# life\n\u003e tiny update function for [life-like cellular automata]\n\n```js\nimport update from \"life\"\n\nlet world = {\n  rule: { birth: [ 3 ], survival: [ 2, 3 ] },\n  cells: [ 1, 0, 1, 1, 1, 2 ]\n}\n\nworld.cells = update(world.cells, world.rule)\nconsole.log(world.cells)\n// -\u003e [ 0, 1, 1, 1, 2, 1 ]\n```\n\n## usage\n[![npm badge]][npm package]\n\n### `update(cells, rule) -\u003e result`\nReceives a list of living `cells` and updates it using `rule`. Returns an updated cell list of the same form as `cells`.\n\n* `cells`: A list of the form `[ x0, y0, x1, y1, ...xn, yn ]` where each `x, y` pair represents a living cell\n* `rule`: A map of the form `{ birth: [ ...neighborCount ], survival: [ ...neighborCount ] }` indicating the outcome when those criteria are met\n\n[npm package]:                 https://www.npmjs.com/package/life\n[npm badge]:                   https://nodei.co/npm/life.png?mini\n[life-like cellular automata]: https://en.wikipedia.org/wiki/Life-like_cellular_automata\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemibran%2Fnode-life","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemibran%2Fnode-life","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemibran%2Fnode-life/lists"}