Giter Site home page Giter Site logo

finite_automaton_sim's Introduction

Finite Automaton Sim

Simulates DFAs and NFAs in Javascript. Can run both in NodeJS and in HTML5.

Created by rubenwardy
License: LGPL 2.1 or later.

API Example

const assert = require('assert');
var Machine = require('./machine');
var Simulator = require('./simulator');

// DFA to accept even number of "a"s
var m = new Machine({a:true, b:true});
m.connect(0, 1, "a");
m.connect(1, 0, "a");
m.connect(0, 0, "b");
m.connect(1, 1, "b");
// implicit: m.makeInitial(0);
m.makeAccept(1);
assert(m.isValid()); // You should always check this

// Test
assert(len(m.states) == 2);
assert(!m.isAccept(m.states[0]));
assert(m.isAccept(m.states[1]));

// Run
var s = new Simulator(m);
assert(!s.isAccept());
s.step("a");
assert(s.isAccept());

Command Line Usage (TODO)

Whilst in ndfa folder:

nodejs .

Then use the command prompt

Tests

Whilst in ndfa folder:

mocha

# or

npm test

finite_automaton_sim's People

Contributors

rubenwardy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

finite_automaton_sim's Issues

Hope you have a miserable new year, and a painful and tragic life ruben

@rubenwardy You are a cheap slave loser ruberwardy. Death to you, and to hell with you garbage CTF server. Death to the UK, and death to their garbage terrorist "national" (death) "service". Death to "universities". Death to the garbage and silly so called "health sector". Death to losers who use stupid "titles" with names. Hope you have a miserable 2022 and a tragic and painful life. You are a worthless loser, and hopefully you'll be punished for your daft mentality. Shame on you .

Shame on you loser

@rubenwardy You are a cheap slave loser ruberwardy. Death to you, and to hell with you garbage CTF server. Death to the UK, and death to their garbage terrorist "national" (death) "service". Death to "universities". Death to the garbage and silly so called "health sector". Death to losers who use stupid "titles" with names. Hope you have a miserable 2022 and a tragic and painful life. You are a worthless loser, and hopefully you'll be punished for your daft mentality. Shame on you .

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.