{"id":19430294,"url":"https://github.com/8dcc/langtons-ant","last_synced_at":"2026-06-10T22:31:38.162Z","repository":{"id":46297446,"uuid":"463301471","full_name":"8dcc/langtons-ant","owner":"8dcc","description":"Langton's ant simulation made in C using SDL2","archived":false,"fork":false,"pushed_at":"2024-02-03T22:11:00.000Z","size":143,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T22:30:58.779Z","etag":null,"topics":["c","cellular-automata","langton-ant","langtons-ant","sdl2","simulation"],"latest_commit_sha":null,"homepage":"","language":"C","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/8dcc.png","metadata":{"files":{"readme":"README.org","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}},"created_at":"2022-02-24T21:05:49.000Z","updated_at":"2024-09-07T14:10:08.000Z","dependencies_parsed_at":"2024-01-23T17:27:35.398Z","dependency_job_id":"fda199b3-91de-43bd-b988-76d3ef5640c2","html_url":"https://github.com/8dcc/langtons-ant","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/8dcc/langtons-ant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Flangtons-ant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Flangtons-ant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Flangtons-ant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Flangtons-ant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8dcc","download_url":"https://codeload.github.com/8dcc/langtons-ant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8dcc%2Flangtons-ant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34174148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","cellular-automata","langton-ant","langtons-ant","sdl2","simulation"],"created_at":"2024-11-10T14:24:18.272Z","updated_at":"2026-06-10T22:31:38.157Z","avatar_url":"https://github.com/8dcc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+title: Langton's ant\n#+options: toc:nil\n#+startup: showeverything\n#+author: 8dcc\n\n*Langton's ant simulation made in C using SDL2.*\n\n#+TOC: headlines 2\n\n* Description\n\nSimple single-source simulation of [[https://en.wikipedia.org/wiki/Langton%27s_ant][langton's ant]], made in under 500 lines of\nC.\n\nSome of the main features:\n- Custom grid size and delay at runtime.\n- Very easy to modify color palette with no size limit. Supports 4 possible\n  rotations when stepping on each color. Modified at compile-time.\n- Unlimited number of ants at runtime, spawned by clicking on the grid.\n- Grid overlay with =g=.\n- Single stepping with =Left arrow= or automatic stepping with =Space=.\n- Easily customizable by changing macros inside the source.\n\n* Building\n\nClone the repository and run =make=. Make sure you have [[https://www.libsdl.org/][SDL2]] installed.\n\n#+begin_src console\n$ git clone https://github.com/8dcc/langtons-ant\n$ cd langtons-ant\n$ make\n...\n#+end_src\n\n* Usage\n\nYou can specify the width, height and delay at runtime.\n\n#+begin_src console\n$ ./langtons-ant\nGrid size: 100x100\nCell size: 5 px\nDelay: 10 ms\n\nStep: 536\n\n$ ./langtons-ant 50 20 200\nGrid size: 50x20\nCell size: 5 px\nDelay: 200 ms\n\nStep: 231\n#+end_src\n\nYou can use the following keys:\n\n| Key         | Description                                            |\n|-------------+--------------------------------------------------------|\n| ~q~ / ~ESC~     | Quit the program.                                      |\n| ~g~           | Toggle grid overlay.                                   |\n| ~f~ / ~F11~     | Toggle full-screen.                                    |\n| ~Left Arrow~  | Single step.                                           |\n| ~Space~       | Toggle auto-stepping.                                  |\n| ~Up Arrow~    | Increase number of steps per frame when auto-stepping. |\n| ~Down Arrow~  | Decrease number of steps per frame when auto-stepping. |\n| ~Left Click~  | Add ant at the specified position.                     |\n| ~Right Click~ | Remove ant at the specified position.                  |\n\n* Screenshots\n\nDifferent ants with default color palette:\n\n[[https://i.imgur.com/vZMhVev.png]]\n\nSingle ant with 9 color palette and custom rotations:\n\n[[https://i.imgur.com/8khDVKx.png]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8dcc%2Flangtons-ant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8dcc%2Flangtons-ant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8dcc%2Flangtons-ant/lists"}