Code Monkey home page Code Monkey logo

turing-machine-js's Introduction

turing-machine.js

Semestral project for A0A33KAJ class taught by Seznam.cz at CTU

Project goal

The goal of this project is to allow students to simulate single-tape deterministic Turing Machine (TM) in an interactive way. You can step trough the iterations of the TM, display and edit the transition table and edit the input.

How to use

First, when you load the page, you can notice there is a big tape in the middle of the screen. This is the TM tape. It is by definition of infinite size. The input symbols are always padded by Blank ("B") symbols on the left and on the right.

If you press "Space", the machine executes a single iteration based on the value in the transition table. On the top of the screen, you can see the current state the machine is in. This can help you to navigate trough the transition table of your TM. The simulator makes a sound when advancing to the next state. You can mute the sound by pressing "M". The browser will try to remember that, so that you don't have to mute the sounds on your next page load of the simulator.

By pressing "R", you reset the TM to its initial state.

If you click the "Click me!" button on the right, an editor pane shows up. There is the transition table and also the TM input form. If the cell is empty, it means there is no transition for that symbol from that state. If there is a value in format ||, it means that if the TM reads the symbol in that state, it will go to the , rewrite the symbol to and move one step in . You may use "qX" for the number of the state, where X is an integer. For direction value, you may use "L" for "left" or "R" for "right". For , you may use any symbol, but if you use a symbol which is not defined in the table, you will break your machine.

By clicking on any of the table cell, you active the transition table editor. A big button "Save transition table" pops up. When you are done modifying the transition table.

To change the input of the TM, you can fill out the "Input" field and click on the "Reset" button. The TM will be reset to initial state (q0) and the transition table will be updated to accommodate for all the unique symbols + the Blank symbol "B". (The symbol "B" is always reserved for the Blank symbol, so I advise you not to use it)

## Contributing

This is a semestral project, so I won't accept your Pull Request until June 2017. However, feel free to report any bug or to suggest any improvement! Thank you :)

Semestral work

You can click the list items and they will redirect you directly to the code.

The structure of the folder is the following:

  • dist/ - Static files live here, contents of this folder are not transpiled
    • css/ - CSS lives here
    • js/ - Transpiled JS files live here
  • src/ - JS lives here, core of the system in ES6 - transpiled by webpack

### General

  • cíl projektu, postup, popis funkčnosti, komentáře ve zdrojovém kódu X 1

HTML 5 / 10

### CSS / 8

Javascript / 12

Ostatní / 5

  • Kompletnost řešení (3)
  • Estetické zpracování (2)

turing-machine-js's People

Contributors

klimesf avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.