Skip to main content

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. 1 if the tape is accepted by the turing machine
  2. -1 if the state is discarded by the turing machine
  3. 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

turing_machine_utils-1.0.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

turing_machine_utils-1.0.2-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page