Turing machine project for uni
  • Python 97.5%
  • Nix 2.5%
Find a file
Joseph DALY 197cdc0a50
All checks were successful
/ test (push) Successful in 10s
drop the encoding header
2026-03-01 17:15:37 +01:00
.forgejo/workflows add test forgejo action 2026-02-27 16:53:58 +01:00
examples unary product let's go 2026-02-28 14:40:21 +01:00
compiler.py don't allow filling up other tapes that's cheating 2026-02-28 14:13:49 +01:00
encoding.py drop the encoding header 2026-03-01 17:15:37 +01:00
eval.py don't allow filling up other tapes that's cheating 2026-02-28 14:13:49 +01:00
flake.lock add nix stuff 2026-02-28 00:21:10 +01:00
flake.nix add nix stuff 2026-02-28 00:21:10 +01:00
license add license and readme 2026-02-26 12:13:41 +01:00
main.py unary product let's go 2026-02-28 14:40:21 +01:00
readme reference encoding.py in readme 2026-03-01 15:17:38 +01:00
readme.fr reference encoding.py in readme 2026-03-01 15:17:38 +01:00
shell.nix add nix stuff 2026-02-28 00:21:10 +01:00
structures.py move encoding stuff to their own class 2026-03-01 14:57:50 +01:00
test.py test the unary/binary format thing 2026-03-01 16:36:09 +01:00

toy-turing

a Turing machine emulator written in Python

designed to parse the same language as https://turingmachinesimulator.com/
here are all the differences:

* my parser doesn't care about newlines, so it can't infer the number
of tapes from transitions. It requires the special meta tag "tapes"
which defaults to 1.
* a special "blank" meta tag can be specificed for the blank symbol.
Defaults to '_'.

here's the layout of the codebase:

* structures.py: immutable structures that define machines
* compiler.py: parser & compiler for the Turing machine language
* eval.py: evaluation functions
* encoding.py: serialization interface
* examples/: Turing machine codes

https://git.notchka.org/Notchka/toy-turing

all the code is licensed under GNU GPL v3 unless stated otherwise