{"id":19979142,"url":"https://github.com/tarunbatra/zindagi","last_synced_at":"2025-07-23T14:03:41.640Z","repository":{"id":56425742,"uuid":"309205092","full_name":"tarunbatra/zindagi","owner":"tarunbatra","description":"A library to easily program and render life-like cellular automata.","archived":false,"fork":false,"pushed_at":"2020-11-09T22:41:09.000Z","size":996,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-29T02:06:43.782Z","etag":null,"topics":["cellular-automata","cellular-automaton","conways-game-of-life","conwaysgameoflife","game-of-life"],"latest_commit_sha":null,"homepage":"https://tarunbatra.com/zindagi","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/tarunbatra.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}},"created_at":"2020-11-01T22:56:27.000Z","updated_at":"2024-07-04T12:28:15.000Z","dependencies_parsed_at":"2022-08-15T18:30:54.418Z","dependency_job_id":null,"html_url":"https://github.com/tarunbatra/zindagi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarunbatra%2Fzindagi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarunbatra%2Fzindagi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarunbatra%2Fzindagi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarunbatra%2Fzindagi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarunbatra","download_url":"https://codeload.github.com/tarunbatra/zindagi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252288910,"owners_count":21724323,"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","cellular-automaton","conways-game-of-life","conwaysgameoflife","game-of-life"],"created_at":"2024-11-13T03:36:48.062Z","updated_at":"2025-05-04T04:32:34.644Z","avatar_url":"https://github.com/tarunbatra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Zindagi][logo]][docs]\n\n[![build status][build-image]][build-url]\n[![coverage status][codecov-image]][codecov-url]\n[![npm version][npm-image]][npm-url]\n![license][license-image]\n\nZindagi is a library to easily program and render [life-like cellular automatas][life-like-wiki] including but not limited to Highlife and [Conway's Game of Life][gol-wiki].\n\n\n## Usage\n\n```js\nimport { Zindagi } from 'zindagi';        // use ES modules\n// const { Zindagi } = require('zindagi); // or CommonJS\n\nconst life = new Zindagi({\n  // Life-like rule\n  rules: 'S23/B3',\n  // Flag to enable alive cells to re-appear on\n  // the other side of the board in case of overflow\n  stitchedEdges: true,\n  // Symbols to represent alive and dead cells in initState param\n  symbols: {\n    alive: '0',\n    dead: '.'\n  },\n  // Initial state of the automata\n  initState: `..........\n              .0........\n              ..00......\n              .00.......\n              ..........\n              ..........\n              ..........\n              ..........`\n});\n\n// play for 1000 generations\nconst generations = life.live(1000);\n\n// in built method to render the automata to console/terminal\nlife.render(generations, {\n    alive: '⬛️',            // represent alive cells with black block\n    dead: '⬜️',             // represent dead cells with white block\n    timePerGeneration: 0.5, // 0.5 seconds per generation\n});\n```\n\n## Output\n![Example Output][example-output-gif]\n\n## Install\n```\nnpm install zindagi\n```\n\n## Documentation\nThis is a list of the methods supproted. A detailed documentation is available in the [documentation section][zindagi-class-doc] of the homepage.\n\n|Method|Description|\n|:-----|:----------|\n|`.live(n)`|Returns an [iterator][mdn-iterator-doc] of the current state plus `n` subsequent states|\n|`.skip(n)`|Returns the current state after moving ahead `n` states|\n|`.reset()`|Resets the current state to the `initState`|\n|`.toString(opts)`|Returns the current state represented as a formatted string|\n|`.render(iterator, opts)`|Renders a cellular automata in console using options|\n\n\u003cbr\u003e\n\n## TODO\n- [x] Documentation\n- [x] Tests\n- [ ] Optimizations\n- [ ] HashLife implementation\n\n\u003cbr\u003e\n\n__Contributions are welcome!__\n\n[logo]: https://res.cloudinary.com/tbking/image/upload/v1604344754/zindagi/zindagi-logo.gif\n[docs]: https://tarunbatra.com/zindagi\n\n[build-image]:https://img.shields.io/github/workflow/status/tarunbatra/zindagi/CI?label=CI\u0026logo=github\u0026style=flat-square\n[build-url]:https://github.com/tarunbatra/zindagi/actions?query=workflow%3ACI\n[codecov-url]: https://codecov.io/gh/tarunbatra/zindagi\n[codecov-image]: https://img.shields.io/codecov/c/gh/tarunbatra/zindagi?logo=codecov\u0026style=flat-square\n[npm-image]: https://img.shields.io/npm/v/zindagi.svg?style=flat-square\u0026color=magenta\n[npm-url]: https://www.npmjs.com/package/zindagi\n[license-image]: https://img.shields.io/github/license/tarunbatra/zindagi?color=pink\u0026style=flat-square\n\n[life-like-wiki]: https://en.wikipedia.org/wiki/Life-like_cellular_automaton\n[gol-wiki]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\n[example-output-gif]: https://res.cloudinary.com/tbking/video/upload/e_loop/v1604362000/zindagi/glider-example.gif\n\n[zindagi-class-doc]: https://tarunbatra.com/zindagi/Zindagi.html\n[mdn-iterator-doc]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarunbatra%2Fzindagi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarunbatra%2Fzindagi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarunbatra%2Fzindagi/lists"}