{"id":19430274,"url":"https://github.com/8dcc/rule110","last_synced_at":"2025-12-31T14:19:21.185Z","repository":{"id":39714666,"uuid":"429804572","full_name":"8dcc/rule110","owner":"8dcc","description":"Rule110 made in C","archived":false,"fork":false,"pushed_at":"2022-06-24T21:52:08.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T12:14:31.859Z","etag":null,"topics":["rule110"],"latest_commit_sha":null,"homepage":"","language":"C","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/8dcc.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}},"created_at":"2021-11-19T13:19:11.000Z","updated_at":"2023-07-16T17:43:12.000Z","dependencies_parsed_at":"2022-08-24T01:31:34.498Z","dependency_job_id":null,"html_url":"https://github.com/8dcc/rule110","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/8dcc%2Frule110","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Frule110/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Frule110/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Frule110/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8dcc","download_url":"https://codeload.github.com/8dcc/rule110/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240612541,"owners_count":19829027,"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":["rule110"],"created_at":"2024-11-10T14:24:13.950Z","updated_at":"2025-12-31T14:19:21.159Z","avatar_url":"https://github.com/8dcc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n\t\u003ch1\u003eRule 110\u003c/h1\u003e\r\n\t\u003cb\u003e\u003ca href=\"https://en.wikipedia.org/wiki/Rule_110\"\u003eRule 110\u003c/a\u003e made in C.\u003c/b\u003e\u003cbr\u003e\r\n   \u003cp\u003eASCII version and \u003ca href=\"https://en.wikipedia.org/wiki/Netpbm\"\u003eNetpbm\u003c/a\u003e version.\u003c/p\u003e\u003cbr\u003e\u003cbr\u003e\r\n\t\u003ca href=\"https://github.com/r4v10l1/rule110/network/members\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/r4v10l1/rule110.svg?style=for-the-badge\u0026logo=c\u0026color=a8b9cc\u0026logoColor=a8b9cc\" alt=\"Forks\"\u003e\u003c/a\u003e\r\n\t\u003ca href=\"https://github.com/r4v10l1/rule110/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/r4v10l1/rule110.svg?style=for-the-badge\u0026logo=c\u0026color=a8b9cc\u0026logoColor=a8b9cc\" alt=\"Stars\"\u003e\u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n# Table of contents\r\n1. [ASCII](https://github.com/r4v10l1/rule110#ASCII)\r\n   - [Configuration](https://github.com/r4v10l1/rule110#ASCII-Configuration)\r\n   - [Functions](https://github.com/r4v10l1/rule110#ASCII-Functions)\r\n2. [Netpbm](https://github.com/r4v10l1/rule110#Netpbm)\r\n   - [Usage](https://github.com/r4v10l1/rule110#Netpbm-Usage)\r\n   - [Configuration](https://github.com/r4v10l1/rule110#Netpbm-Configuration)\r\n   - [Functions](https://github.com/r4v10l1/rule110#Netpbm-Functions)\r\n3. [Examples](https://github.com/r4v10l1/rule110#Examples)\r\n4. [Todo](https://github.com/r4v10l1/rule110#Todo)\r\n\r\n## ASCII\r\nYou can see an example [here](https://raw.githubusercontent.com/r4v10l1/rule110/main/example.txt).\r\n\r\n### ASCII Configuration\r\n#### Display\r\n- `STEPS`: The ammount of lines to be printed.\r\n- `MAX_LINE_LEN`: Won't print characters that exceed this position. **If the value is `0`, it will turn off this option.**\r\n#### Characters\r\n- `FILLCHAR`: The character that the program will print as `1`.\r\n- `EMPTYCHAR`: The character that the program will print as `0`.\r\n#### Settings\r\n- `PRINT_DETAILS`: If `1`, it will print useful information before displaying the simulation.\r\n\r\n### ASCII Functions\r\n```c\r\nint calc_rule(int a, int b, int c, int mode);\r\n```\r\n`a`, `b` and `c` are the states of the cells, left to right. `mode == 1` will switch the variables `a` and `b`.\r\n\r\n- `mode == 0`:\r\n\r\n   a | b | c \r\n  ---|---|---\r\n     | r |   \r\n     \r\n   1 | 0 | 0 \r\n  ---|---|---\r\n     | 0 |   \r\n     \r\n- `mode == 1`:\r\n\r\n   c | b | a \r\n  ---|---|---\r\n     | r |   \r\n\r\n   0 | 0 | 1 \r\n  ---|---|---\r\n     | 0 |   \r\n\r\nWhere `r` is the value returned.\r\n\r\n## Netpbm\r\nYou can see an example [here](https://raw.githubusercontent.com/r4v10l1/rule110/main/examples/example2.png).\r\n\r\n### Netpbm Usage\r\n```bash\r\nrule110-netpbm.o \u003e output.pbm\r\n```\r\n\r\n### Netpbm Configuration\r\n#### Display\r\n- `HEIGHT`: The height of the `.pbm` file.\r\n- `WIDTH`: The width of the `.pbm` file.\r\n\r\n### Netpbm Functions\r\n```c\r\nint calc_rule(int a, int b, int c, int mode);\r\nint calc_array();\r\n```\r\n## Examples\r\n\u003cimg src=\"https://raw.githubusercontent.com/r4v10l1/rule110/main/examples/example3.png\" alt=\"Example image 1\" height=\"100px\" width=\"100px\"\u003e\r\n\r\n![Example image 2](https://raw.githubusercontent.com/r4v10l1/rule110/main/examples/example2.png)\r\n\r\n## Todo\r\n- [X] The image does weird shit depending on the width. If HEIGHT \u003e WIDTH, the image is ok.\r\n- [X] Format the code for the ascii version.v\r\n- [ ] Format the code for the pmb version.v\r\n- [ ] Add `compile.sh`\r\n- [X] Make the simulation infinite if steps is 0.\r\n- [ ] Make a version in SDL2?\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8dcc%2Frule110","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8dcc%2Frule110","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8dcc%2Frule110/lists"}