{"id":21722715,"url":"https://github.com/czukowski/gol","last_synced_at":"2026-04-29T09:04:14.509Z","repository":{"id":138546207,"uuid":"90449761","full_name":"czukowski/gol","owner":"czukowski","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-12T16:33:42.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-13T02:02:19.344Z","etag":null,"topics":["forfun"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/czukowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-05-06T08:44:44.000Z","updated_at":"2018-11-12T16:33:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6328923-cf6d-498b-9d0e-a6363284667f","html_url":"https://github.com/czukowski/gol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/czukowski/gol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czukowski%2Fgol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czukowski%2Fgol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czukowski%2Fgol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czukowski%2Fgol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/czukowski","download_url":"https://codeload.github.com/czukowski/gol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czukowski%2Fgol/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259565528,"owners_count":22877344,"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":["forfun"],"created_at":"2024-11-26T02:32:16.744Z","updated_at":"2026-04-29T09:04:09.448Z","avatar_url":"https://github.com/czukowski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Game of Life, of sorts\n======================\n\nA simple simulation, not unlike you may have seen in a [Darwinia intro][darwinia],\nthis one here is written in PHP and has a different set of rules.\n\nTo run, use the following command:\n\n```sh\nphp bin/index.php\n```\n\nThe initial world seed used by default is hardcoded (for now) in `bin/index.php`.\n\nRules\n-----\n\nConsider a representation of a \"world\" as an n by n matrix. Each element in the matrix may\ncontain 1 organism. Each organism lives, dies and reproduces according to the following set\nof rules:\n\n * If there are two or three organisms of the same type living in the elements surrounding an\n   organism of the same, type then it may survive.\n * If there are less than two organisms of one type surrounding one of the same type then it will\n   die due to isolation.\n * If there are four or more organisms of one type surrounding one of the same type then it will\n   die due to overcrowding.\n * If there are exactly three organisms of one type surrounding one element, they may give birth\n   into that cell. The new organism is the same type as its parents. If this condition is true for\n   more than one species on the same element then species type for the new element is chosen\n   randomly.\n * If two organisms occupy one element, one of them must die (chosen randomly) (only to resolve\n   initial conflicts).\n\nThe \"world\" and initial distribution of organisms within it is defined by an XML file of the\nfollowing format:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF­8\"?\u003e\n\u003clife\u003e\n    \u003cworld\u003e\n        \u003c!-- Dimension of the square \"world\" --\u003e\n        \u003ccells\u003en\u003c/cells\u003e\n        \u003c!-- Number of distinct species --\u003e\n        \u003cspecies\u003em\u003c/species\u003e\n        \u003c!-- Number of iterations to be calculated --\u003e\n        \u003citerations\u003e4000000\u003c/iterations\u003e\n    \u003c/world\u003e\n    \u003corganisms\u003e\n        \u003corganism\u003e\n            \u003c!-- x position --\u003e\n            \u003cx_pos\u003ex\u003c/x_pos\u003e\n            \u003c!-- y position --\u003e\n            \u003cy_pos\u003ey\u003c/y_pos\u003e\n            \u003c!-- Species type --\u003e\n            \u003cspecies\u003et\u003c/species\u003e\n        \u003corganism\u003e\n    \u003c/organisms\u003e\n\u003c/life\u003e\n```\n\nAfter iterations, the state of the \"world\" is to be saved in an XML file, `out.xml`, of the same\nformat as the initial definition file.\n\n [darwinia]: https://youtu.be/RIqPWw0sqOI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczukowski%2Fgol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fczukowski%2Fgol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczukowski%2Fgol/lists"}