{"id":16627094,"url":"https://github.com/ttulka/chickenfoot","last_synced_at":"2025-06-28T18:04:03.589Z","repository":{"id":211598558,"uuid":"729561321","full_name":"ttulka/chickenfoot","owner":"ttulka","description":"Two-dimensional programming language for chickens 🐔","archived":false,"fork":false,"pushed_at":"2024-06-12T14:54:52.000Z","size":227,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T19:21:34.956Z","etag":null,"topics":["2d","chicken","esolang","programming-language","two-dimensional"],"latest_commit_sha":null,"homepage":"https://esolangs.org/wiki/Chickenfoot","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/ttulka.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":"2023-12-09T16:09:49.000Z","updated_at":"2024-09-12T13:00:18.000Z","dependencies_parsed_at":"2025-02-13T11:42:42.861Z","dependency_job_id":null,"html_url":"https://github.com/ttulka/chickenfoot","commit_stats":null,"previous_names":["ttulka/chickenfoot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fchickenfoot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fchickenfoot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fchickenfoot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttulka%2Fchickenfoot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttulka","download_url":"https://codeload.github.com/ttulka/chickenfoot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247611035,"owners_count":20966458,"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":["2d","chicken","esolang","programming-language","two-dimensional"],"created_at":"2024-10-12T04:13:20.490Z","updated_at":"2025-04-07T07:28:36.875Z","avatar_url":"https://github.com/ttulka.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chickenfoot\n\n\u003cimg src=\"logo.png\" style=\"width: 30%; float: right; margin: 1rem 0 1rem 2rem; border-radius: 1rem; max-width: 250px; float: right\" align=\"right\" width=\"250\"\u003e\n\n🐔 Chickenfoot is a two-dimensional programming language for chickens.\n\nInspired by a chicken tap dance with dominos:\n\n\n```chickenfoot\n          ⠮       ⠮\n         ⠮ ⠫     ⠮ ⠫\n        ⠷⠈⠧⠩    ⠷⠌⠧⠩\n       ⠹ ⠼     ⠹\n      ⠹   ⠼   ⠹\n     ⠹     ⠼ ⠹\n⠿⠽⠽⠽⠘⠋⠏⠠⠬   ⠚⠋⠏⠢⠬\n     ⠫  ⠮    ⠫  ⠮\n      ⠫⠯      ⠫⠯\n```\n\n## How it works\n\nThe program is equipped with **four registers** further referenced as\n *r0*, *r1*, *r2*, and *r3*. Each register holds an unbounded integer\n value.\n\nThe execution starts at the begin command and continues left-to-right\n as the default. The flow can be altered by the \n *conditional branching command* or by a handful of *flow commands*. \n In this way, loops can be created.\n\nThe program halts when a whitespace is read.\n\n## Commands\n\nEach command consists of a single symbol of the Braille 6-dot patterns:\n\n```\n  1 2\nA o o\nB o o\nC o o\n```\n\nBraille symbols that do not fit any command definition and all other\n symbols are interpreted as whitespaces.\n\nThe **begin** command `⠿` indicates the beginning of the program. \n Each program must include exactly one begin command:\n\n```chickenfoot\n⠿\n```\n\nExcept for the begin command, dots in the second column indicate the\n operation:\n\n| Col | Rows | Operation             | Precedence | Examples |\n|:---:|:----:| --------------------- |:----------:|:--------:|\n| 2   | A    | Increment             | 1          | `⠏`, `⠋` |\n| 2   | C    | Decrement             | 1          | `⠧`, `⠦` |\n| 2   | B    | Conditional branching | 2          | `⠟`, `⠷` |\n| 2   | A+C  | Flow                  | 3          | `⠽`, `⠫` |\n\nOperations *conditional branching* and *flow* combine other dots as\n additional parameters.\n\nFor **arithmetic commands** increment, decrement, and the \n **control flow** command conditional branching, the number of dots in\n the first column indicates the index of a register to work with:\n\n| Col | Number of dots | Register | Examples |\n|:---:|:--------------:|:--------:|:--------:|\n| 1   | 0              | r0       | `⠈`, `⠘` |\n| 1   | 1              | r1       | `⠉`, `⠜` |\n| 1   | 2              | r2       | `⠋`, `⠝` |\n| 1   | 3              | r3       | `⠏`, `⠟` |\n\nThe vertical position of dots in the column is irrelevant and fully\n aesthetics-driven. The following commands are equivalent:\n `⠋`, `⠍`, `⠎`.\n\n### Increment\n\nThe increment command increases the value of the selected register.\n\nAn example of incrementing *r2* two times:\n\n```chickenfoot\n⠿⠍⠋\n```\n\n### Decrement \n\nThe decrement command decreases the value of the selected register if \n its current value is greater than zero.\n\nAn example of decrementing *r1* two times after \n incrementing it three times:\n\n```chickenfoot\n⠿⠉⠉⠉⠡⠢\n```\n\n### Conditional branching\n\nConditional branching changes the control flow based on the current \n value of the selected register. If the value equals zero, the flow \n branches; otherwise, it continues left-to-right.\n\nThe command always comes with another dot in the second row, which \n indicates the direction of the control flow in the case when the value\n of the selected register is **equal to zero**:\n\n| Rows | Zero flow direction  | Examples |\n|:----:| -------------------- |:--------:|\n| B+A  | Northeast (↗)        | `⠟`, `⠙` |\n| B+C  | Southeast (↘)        | `⠷`, `⠱` |\n\nAn example of setting *r3* to one if *r2* is greater than three:\n\n```chickenfoot\n⠿⠣⠣⠣⠳⠏\n```\n\n### Flow\n\nThe flow operation changes the control flow of the program.\n\nThe number of dots in the first column indicates the direction:\n\n| Command | Flow direction  |\n|:-------:| --------------- |\n| `⠩`     | North (↑)       |\n| `⠹`     | Northeast (↗)   |\n| `⠽`     | East (→)        |\n| `⠼`     | Southeast (↘)   |\n| `⠬`     | South (↓)       |\n| `⠮`     | Southwest (↙)   |\n| `⠯`     | West (←)        |\n| `⠫`     | Northwest (↖)   |\n\nA flow into the chicken hole:\n\n```chickenfoot\n⠿⠽⠽⠽⠽⠼\n ⠫     ⠬\n ⠩     ⠮\n  ⠫⠯⠯⠯\n```\n\n## Examples\n\n### No-op program\n\nThe simplest valid program:\n\n```chickenfoot\n⠿\n```\n\n### Infinite loop\n\nDon't try this at home!\n\n```chickenfoot\n⠿⠯\n```\n\n### Truth-machine\n\nIf *r0* contains 1, the program sets *r1* to 1:\n\n```chickenfoot\n⠿⠰⠊\n```\n\n### Copier\n\nThe program copies content of *r0* to *r1*:\n\n```chickenfoot\n  ⠮⠯⠯⠯\n⠿⠰⠊⠍⠠⠩\n  ⠼ ⠮⠯⠯\n   ⠵⠈⠣⠩\n```\n\n### Fibonacci sequence\n\nThe program takes an index in *r0* and computes the corresponding \n Fibonacci number in *r2*:\n\n```chickenfoot\n        ⠮\n       ⠮ ⠫\n⠿⠰⠋⠠⠘⠠⠳⠣⠌⠏⠫\n     ⠫ ⠼\n      ⠫ ⠼ ⠮⠯\n       ⠫ ⠲⠢⠎⠫\n        ⠫ ⠼\n         ⠫ ⠼ ⠮⠯\n          ⠫ ⠷⠧⠌⠫\n           ⠫⠯⠯\n```\n\n### Addition of two numbers\n\nAn alternative version of a program which adds values in *r0* and *r1*\n to *r2*:\n\n```chickenfoot\n             ⠟⠉⠧⠬\n            ⠹   ⠮\n           ⠹ ⠫⠯⠯\n          ⠹\n         ⠚⠋⠏⠢⠬\n        ⠹    ⠮\n       ⠹ ⠫⠯⠯⠯\n      ⠹\n     ⠟⠈⠧⠬\n    ⠹   ⠮\n   ⠹ ⠫⠯⠯\n  ⠹\n⠿⠘⠎⠏⠠⠬\n  ⠫  ⠮\n   ⠫⠯\n```\n\n## Try it\n\nThis repository contains a JavaScript interpreter for Chickenfoot.\n\n```sh\nnpm i chickenfoot\n```\n\nIt takes source code as the first argument and optionally initial\n register values:\n\n```js\nconst chickenfoot = require('chickenfoot')\n\n// addition of two numbers\nconst output = chickenfoot(`\n         ⠮       ⠮\n        ⠮ ⠫     ⠮ ⠫\n       ⠷⠈⠧⠩    ⠷⠌⠧⠩\n      ⠹ ⠼     ⠹\n     ⠹   ⠼   ⠹\n    ⠹     ⠼ ⠹\n  ⠿⠘⠋⠏⠠⠬   ⠚⠋⠏⠢⠬\n    ⠫  ⠮    ⠫  ⠮\n     ⠫⠯      ⠫⠯\n  `,\n  2, 3)  // x=2, y=3\n\noutput[0] // 2 (x)\noutput[1] // 3 (y)\noutput[2] // 5 (x+y)\noutput[3] // 0\n```\n\n## Development\n\n**Cascadia Code** is the recommended code editor font for Chickenfoot.\n\n### Testing\n\n```sh\nnpm test\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttulka%2Fchickenfoot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttulka%2Fchickenfoot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttulka%2Fchickenfoot/lists"}