{"id":22413152,"url":"https://github.com/zodddev/pyturingmachine","last_synced_at":"2025-03-27T03:24:49.566Z","repository":{"id":65291510,"uuid":"589323549","full_name":"zoddDev/pyTuringMachine","owner":"zoddDev","description":"TuringMachine simulator","archived":false,"fork":false,"pushed_at":"2023-01-15T20:14:21.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T08:47:57.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoddDev.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}},"created_at":"2023-01-15T19:54:27.000Z","updated_at":"2023-01-15T19:55:59.000Z","dependencies_parsed_at":"2023-01-16T07:56:14.440Z","dependency_job_id":null,"html_url":"https://github.com/zoddDev/pyTuringMachine","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/zoddDev%2FpyTuringMachine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoddDev%2FpyTuringMachine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoddDev%2FpyTuringMachine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoddDev%2FpyTuringMachine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoddDev","download_url":"https://codeload.github.com/zoddDev/pyTuringMachine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245774708,"owners_count":20669996,"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-12-05T14:12:01.492Z","updated_at":"2025-03-27T03:24:49.549Z","avatar_url":"https://github.com/zoddDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Turing Machine simulator :snake:\n\n## You can find an already built example: ![main.py](https://github.com/zoddDev/pyTuringMachine/blob/main/main.py)\n\n```python\n# TM Example\n\nstates = {'q0', 'q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8'}\nalphabet = {'*', '|'}\nits = {\n    IT('q0', '*', LEFT, 'q1'),\n    IT('q0', '|', LEFT, 'q0'),\n\n    IT('q1', '*', LEFT, 'q2'),\n    IT('q1', '|', LEFT, 'q1'),\n\n    IT('q2', '*', LEFT, 'q2'),\n    IT('q2', '|', '*', 'q3'),\n\n    IT('q3', '*', LEFT, 'q4'),\n    IT('q3', '|', '|', 'q3'),\n\n    IT('q4', '*', HALT, 'q4'),\n    IT('q4', '|', RIGHT, 'q5'),\n\n    IT('q5', '*', RIGHT, 'q5'),\n    IT('q5', '|', '*', 'q6'),\n\n    IT('q6', '*', RIGHT, 'q7'),\n    IT('q6', '|', '|', 'q6'),\n\n    IT('q7', '*', '|', 'q8'),\n    IT('q7', '|', LEFT, 'q2'),\n\n    IT('q8', '*', '*', 'q8'),\n    IT('q8', '|', HALT, 'q8'),\n}\n\ninitial_state = 'q0'\n\ninitial_configuration = Configuration(\n    'q0',\n    Tape(\n        list('*||*|*'),\n        0\n    ),\n    5\n)\n\nits_tuple = get_transitions_and_instructions(its)\ntransitions = its_tuple[0]\ninstructions = its_tuple[1]\n\ntm = TM(\n    states,\n    initial_state,\n    alphabet,\n    instructions,\n    transitions,\n    initial_configuration\n)\n```\n\n\n## Execution trace\n```python\nConfiguration(q0, Tape(* | | * | *), 5) |-\nConfiguration(q1, Tape(* | | * | *), 4) |-\nConfiguration(q1, Tape(* | | * | *), 3) |-\nConfiguration(q2, Tape(* | | * | *), 2) |-\nConfiguration(q3, Tape(* | * * | *), 2) |-\nConfiguration(q4, Tape(* | * * | *), 1) |-\nConfiguration(q5, Tape(* | * * | *), 2) |-\nConfiguration(q5, Tape(* | * * | *), 3) |-\nConfiguration(q5, Tape(* | * * | *), 4) |-\nConfiguration(q6, Tape(* | * * * *), 4) |-\nConfiguration(q7, Tape(* | * * * *), 5) |-\nConfiguration(q8, Tape(* | * * * |), 5) |-\nConfiguration(q8, Tape(* | * * * |), 5) |-\n```\n\n## TODO 📝\n\n- Add interactive command line mode\n- Accept JSON as an input\n- Add support for any number of tapes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzodddev%2Fpyturingmachine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzodddev%2Fpyturingmachine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzodddev%2Fpyturingmachine/lists"}