{"id":15540276,"url":"https://github.com/rm-hull/turmites","last_synced_at":"2025-04-23T16:43:40.555Z","repository":{"id":6092853,"uuid":"7319822","full_name":"rm-hull/turmites","owner":"rm-hull","description":"A turmite is a Turing machine which has an orientation as well as a current state and a \"tape\" that consists of an infinite two-dimensional grid of cells. ClojureScript / HTML5 Canvas / Heroku.","archived":false,"fork":false,"pushed_at":"2014-01-05T01:12:57.000Z","size":320,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-03T12:17:40.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://turmites.destructuring-bind.org","language":"Clojure","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/rm-hull.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":"2012-12-25T19:14:02.000Z","updated_at":"2024-02-03T01:08:59.000Z","dependencies_parsed_at":"2022-08-27T11:31:28.475Z","dependency_job_id":null,"html_url":"https://github.com/rm-hull/turmites","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fturmites","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fturmites/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fturmites/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fturmites/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/turmites/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472197,"owners_count":21436095,"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-10-02T12:13:25.031Z","updated_at":"2025-04-23T16:43:40.540Z","avatar_url":"https://github.com/rm-hull.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"Turmites\n========\nA simple _N_-state two-color Turing machine which operates on a wrapped \ngrid of black and white cells, and follows custom rules on every tick of \na clock.\n\nSee http://turmites.destructuring-bind.org for a running example.\nBy default one ant is automatically created; Extra ants may be added\nby clicking on the canvas. \n\nRules may be specified by adding a `rule=...` parameter, of which some \npermissible values are shown below. \n\n* [langtons-ant](http://turmites.destructuring-bind.org/?rule=langtons-ant) (which has an implicit rule of 120080)\n\n* [coiled-rope](http://turmites.destructuring-bind.org/?rule=coiled-rope) (implicit rule: 111180121010)\n\n* [computer-art](http://turmites.destructuring-bind.org/?rule=computer-art) (implicit rule: 180121020081)\n\n* [fibonacci](http://turmites.destructuring-bind.org/?rule=fibonacci) (implicit rule: 181181121010)\n\n* [worm-trails](http://turmites.destructuring-bind.org/?rule=worm-trails) (implicit rule: 121181121020)\n\n* [striped-spiral](http://turmites.destructuring-bind.org/?rule=striped-spiral) (implicit rule: 021080181020)\n\nA full list of pre-defined rules can be found [here](https://github.com/rm-hull/turmites/blob/master/src/turmites/client/core.cljs#L33).\nIf no rule is given, then a pre-defined one will be selected at random.\nOr, alternatively, the rule definitions may be specified as a sequence \nof numeric digits, eg. http://turmites.destructuring-bind.org/?rule=021080181020\n\nAn _N_-state two-color rule consists of _2N_ triples, _{a,b,c}_, where:\n\n* _a_: the new color of the square\n\n* _b_: the direction(s) for the turmite to turn\n\n* _c_: the new internal state of the turmite\n\nFor example, the fibonacci turmite, has rule definition _181181121010_ has \ntwo states and two colors, and is split into four triples {1,8,1}, {1,8,1},\n{1,2,1} and {0,1,0}. The particulat triple is selected based on the current\nstate and the current color. The {1,8,1} triple therefore states that the \ncolour should change to 1, turn left (8) and adopt state 1 before moving \nforwards.\n\nThe direction to turn is specified by: \n\n* 1: no turn\n\n* 2: right\n\n* 4: u-turn\n\n* 8: left\n\nThe actions are specified by a state transition table listing the current \ninternal state of the turmite and the color of the cell it is currently \nstanding on. For example, the next rule-set to use for the fibonacci triples\nshown above are used by the following table:\n\n                              current-color = 0    current-color = 1\n    current-state = 0              1,8,1                1,8,1\n    current-state = 1              1,2,1                0,1,0\n    \nSo if the current state is 1 and the current color is 0, then the {1,2,1} \ntriple is selected and the new color, direction and state are derived from\nthat.\n\nBuilding and Running\n--------------------\nInvoke a noir instance using leiningen:\n\n    $ lein run\n\nThe clojure script will compiled down to javascript as part of the build,\nso browse to [http://localhost:8080](http://localhost:8080)\n\nEditing Code\n------------\nDon't try to edit the javascript - it is compiled from ClojureScript \nin `src/turmites/client/core.cljs` using Leiningen with the lein-cljsbuild \nplugin:\n\n    $ lein cljsbuild clean\n    $ lein cljsbuild auto\n\nRefresh the page in the browser after having saved the file and allow\nfor the compilation phase to complete.\n\nNotes\n-----\nTurmites are a generalization of [Langtons-ants](https://github.com/rm-hull/langtons-ants). \n\nInspired (in part) by Stephen Wolfram's, \"A New Kind of Science\", ISBN 1-57955-008-8\n\nReferences\n----------\n* http://www.maa.org/editorial/mathgames/mathgames_06_07_04.html\n\n* http://code.google.com/p/ruletablerepository/wiki/TwoDimensionalTuringMachines\n\n* http://demonstrations.wolfram.com/Turmites/\n\n* https://en.wikipedia.org/wiki/Turmite \n\n* http://golly.sourceforge.net/\n\nLicense\n-------\nCopyright (c) Richard Hull 2012\n\nSame as the eclipse public license - v 1.0: https://www.eclipse.org/legal/epl-v10.html\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rm-hull/turmites/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fturmites","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fturmites","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fturmites/lists"}