A simple, browser‑based implementation of a deterministic Turing machine. Designed for education, experimentation, and demonstrations of computability concepts.
This project provides a minimal Turing machine simulator written in HTML, CSS, and JavaScript. It allows users to define states, transitions, and tape contents, then step through executions to observe how the machine processes input.
The core files are:
index.html– UI and structurescript.js– simulation logicstyle.css– basic styling
- Define machine states and transition rules
- Load a custom tape alphabet and input
- Step‑through execution or run to completion
- Visual representation of tape head movement and state changes
- Simple, extensible codebase suitable for learning or integration
No build tools or external dependencies are required – just a modern web browser.
-
Clone or download the repository:
git clone https://github.com/yourusername/turing-machine.git cd turing-machine -
Open
index.htmlin your browser (double‑click or use an HTTP server).Tip: You can serve the folder with Python:
python3 -m http.server 8000
then visit
http://localhost:8000in your browser.
- Enter the set of states and specify the start/accept/reject states.
- Add transition rules using the UI.
- Input the initial tape contents.
- Click Step to advance one transition, or Run to execute fully.
- Observe the tape and current state displayed on screen.
Feel free to adapt or extend the simulator:
- Add support for non‑deterministic machines
- Improve the user interface with frameworks or animations
- Export/import machine definitions
Contributions via pull requests are welcome. Please follow standard GitHub contribution guidelines if you add one.
This project is released under the MIT License – see LICENSE for details.
🎓 Designed as an educational tool, the Turing Machine Simulator aims to help students and hobbyists visualise the mechanics of computation.
