Calculate the result of a turing machine on a given tape
Project description
TuringMachine
Project Name
A brief description of your project.
Table of Contents
Introduction
Provide a brief introduction to your project. Mention its purpose, main features, and any other relevant information.
Features
List the key features of your project. What makes it unique or useful?
Installation
pip install turing-machine-utils
Usage
from turing_machine_utils import create_turing_machine
# Define Turing Machine states, alphabet, and transition rules
states = ['q0', 'q1', 'accept', 'discard']
transition_rules = {
('q0', '0'): ('q1', '1', 'R'),
('q0', '1'): ('q0', '0', 'R'),
('q1', '0'): ('accept', '0', 'L'),
('q1', '1'): ('discard', '1', 'L'),
}
# Define the input tape
tape = ['0', '1', '0', '1', '0']
# Run the Turing Machine
result = create_turing_machine(tape, states, transition_rules)
print("Result:", result)
The result will be:
- 1 if the tape is accepted by the turing machine
- -1 if the state is discarded by the turing machine
- 0 if an undefined transition is found by the turing machine
Configuration
No specific configuration options are available at the moment.
Contributing
Feel free to contribute by reporting issues, suggesting improvements, or submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for turing_machine_utils-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 431b4b5013ad4359941899fd732f57e64b9f83fac861610359e302a8767b1194 |
|
MD5 | 813c3e497ab82820bf58ce2e82404004 |
|
BLAKE2b-256 | 358c2073bf0db82f1cbc919d64903f39ee49061dba8504b7ebaee53c00710293 |
Close
Hashes for turing_machine_utils-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44b4cb95c7e22dab7bd4504be2a91a391e8f4bcced508002c9f7d69bd591b02a |
|
MD5 | 237bd69aaa3053dd56fb9873f13f780b |
|
BLAKE2b-256 | 5342dbe1eddaa7b3385dcab3fabafbd751b13b78a09dd848e05fe52994395a86 |