{"id":21913324,"url":"https://github.com/tahnok/rule110","last_synced_at":"2025-07-07T18:32:46.529Z","repository":{"id":139621453,"uuid":"38212602","full_name":"tahnok/rule110","owner":"tahnok","description":"Simple ruby implemenation of rule 110","archived":false,"fork":false,"pushed_at":"2015-06-28T20:12:05.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T08:48:18.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tahnok.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":"2015-06-28T20:11:46.000Z","updated_at":"2015-06-28T20:12:06.000Z","dependencies_parsed_at":"2023-03-13T10:46:37.287Z","dependency_job_id":null,"html_url":"https://github.com/tahnok/rule110","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tahnok/rule110","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahnok%2Frule110","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahnok%2Frule110/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahnok%2Frule110/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahnok%2Frule110/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tahnok","download_url":"https://codeload.github.com/tahnok/rule110/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahnok%2Frule110/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264130495,"owners_count":23562038,"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":[],"created_at":"2024-11-28T18:16:09.718Z","updated_at":"2025-07-07T18:32:46.511Z","avatar_url":"https://github.com/tahnok.png","language":"Ruby","readme":"This is a simple ruby implementation of [Rule 110](https://en.wikipedia.org/wiki/Rule_110)\n\n## How it works\n\nRule 110 is a cellular automaton (like the game of life) that has been prooven to be Turing Complete (!!!)\n\nThe rules are simple. For a given row of cells (either alive or dead), you can derive the next row by doing the following:\n\nFOR each cell:\n\nIF it's an edge cell (that is, it's touching the side), it's either dead or alive based on the cell directly above it\n\nELSE it's alive or dead based on the 3 cells above it according to the following rules:\n\n```\n+------+--------+-------+--------+\n| Left | Middle | Right | Output |\n+------+--------+-------+--------+\n|    1 |      1 |     1 |      0 |\n|    1 |      1 |     0 |      1 |\n|    1 |      0 |     1 |      1 |\n|    1 |      0 |     0 |      0 |\n|    0 |      1 |     1 |      1 |\n|    0 |      1 |     0 |      1 |\n|    0 |      0 |     1 |      1 |\n|    0 |      0 |     0 |      0 |\n+------+--------+-------+--------+\n```\n(1 = alive, 0 = dead)\n\nRepeat for as long as you want!\n\n## How to use it\n\nYou can run:\n\n```ruby rule110.rb```\n\nTo get a get an output like:\n\n```\n█   █  ██ █████   █  ██ █████  █  ██ █████\n█  ██ █████   █  ██ █████   █ ██ █████   █\n█ █████   █  ██ █████   █  ███████   █  ██\n███   █  ██ █████   █  ██ ██     █  ██ ███\n█ █  ██ █████   █  ██ ██████    ██ █████ █\n███ █████   █  ██ █████    █   █████   ███\n█ ███   █  ██ █████   █   ██  ██   █  ██ █\n███ █  ██ █████   █  ██  ███ ███  ██ █████\n█ ███ █████   █  ██ ███ ██ ███ █ █████   █\n███ ███   █  ██ █████ ██████ █████   █  ██\n█ ███ █  ██ █████   ███    ███   █  ██ ███\n███ ███ █████   █  ██ █   ██ █  ██ █████ █\n█ ███ ███   █  ██ █████  █████ █████   ███\n███ ███ █  ██ █████   █ ██   ███   █  ██ █\n█ ███ ███ █████   █  █████  ██ █  ██ █████\n███ ███ ███   █  ██ ██   █ █████ █████   █\n█ ███ ███ █  ██ ██████  ████   ███   █  ██\n███ ███ ███ █████    █ ██  █  ██ █  ██ ███\n█ ███ ███ ███   █   █████ ██ █████ █████ █\n███ ███ ███ █  ██  ██   ██████   ███   ███\n█ ███ ███ ███ ███ ███  ██    █  ██ █  ██ █\n███ ███ ███ ███ ███ █ ███   ██ █████ █████\n█ ███ ███ ███ ███ █████ █  █████   ███   █\n███ ███ ███ ███ ███   ███ ██   █  ██ █  ██\n█ ███ ███ ███ ███ █  ██ ████  ██ █████ ███\n███ ███ ███ ███ ███ █████  █ █████   ███ █\n█ ███ ███ ███ ███ ███   █ ████   █  ██ ███\n███ ███ ███ ███ ███ █  ████  █  ██ █████ █\n█ ███ ███ ███ ███ ███ ██  █ ██ █████   ███\n```\n\nFeel free to mess around and get different outputs by changing the number of rows, or the starting state\n\nYou can even change rule 110 to your own rule and see what happens\n\n### PNG Output\n\nIf you're feeling more adventurous you can set up bundler (`bundle install`) and then run:\n\n```ruby rule110_png.rb```\n\nTo get a file called rule110.png\n\nIt has a `scale_factor`, as well as a spot where you can change the colours output\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahnok%2Frule110","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftahnok%2Frule110","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahnok%2Frule110/lists"}