Skip to content

guychuk/automata-simulator

Repository files navigation

🤖 Automata Simulator

Logo

An automata simulator.

🧠 Overview

This is a simulator for various types of automata, built with TypeScript. It allows you to define, visualize, and simulate the behavior of finite state machines:

  • DFA (Deterministic Finite Automaton)
  • 🔀 NFA (Non-deterministic Finite Automaton)

✨ Features

  • 🔄 Finite State Automata Simulation
    Supports both DFA and NFA simulations.

  • 🎨 Visualization
    See the automaton graphically and follow transitions live.

  • ⏱️ Step-by-step Execution
    Simulate your automaton one step at a time for better understanding.

  • 🧾 Clear Results
    Displays simulation results in a user-friendly format.

💻 Local Installation

  1. Prerequisites

  2. Clone the repository

    git clone https://github.com/guychuk/automata-simulator.git
    cd automata-simulator
  3. Install dependencies

    npm install
  4. Build the project

    npm run build

    This creates a dist folder with compiled files.

  5. Run locally

    • Open dist/index.html in your browser.
  6. Or start a local dev server

    npm run serve

🧪 Usage

  1. Define your automaton:

    • Enter your alphabet, states, initial state, accepting states, and transitions.
    • Submit using the "Submit Automaton" button.
    • Use an empty string for ε-transitions: q0,,q2
  2. Run the simulator:

    • Enter your input string.
    • (Optional) Adjust step duration.
    • Click "Run" to start simulation.

🎥 Demo

demo

This shows an automaton checking if a binary number is divisible by 3.

  • 1010 (10) → ❌ Not divisible
  • 1011 (11) → ❌ Not divisible
  • 1100 (12) → ✅ Divisible

🌐 Live Demo

Try it now on GitHub Pages 👉 Live Demo.

📚 Project History

This project was originally developed as part of the white-rabbit repository.

To view the full commit history and earlier development, visit:
➡️ white-rabbit 🐇

About

An automata simulator (supporting DFA and NFA).

Topics

Resources

Stars

Watchers

Forks