Skip to content

A Deterministic Finite State Automaton (DFSA) that detects combos in a fighting game.

Notifications You must be signed in to change notification settings

MapReduceMages/dfsa_combo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dfsa_combo

A Deterministic Finite State Automaton (DFSA) that detects combos in a fighting game.

Recordit GIF

Usage

npm install
npm run exec ./grammars/example_2.gmr

Grammar

The grammar is defined in a .gmr file.

The grammar is defined by twi main sections: actions and combos. The actions are defined by a key/input and a value (the name) separated by an equal sign. The combos are defined by a name and a sequence of actions separated by a plus sign. The actions and combos are separated by an ampersand.

a=action_a
b=action_b
c=action_c
&
COMBO_A=action_a
COMBO_A_2=action_a
COMBO_A_3=action_a
COMBO_BB=action_b+action_b
COMBO_BBB=action_b+action_b+action_b
COMBO_BBC=action_b+action_b+action_c

It is possible to have multiple combos with the same sequence of actions. In this case, the DFSA will detect the longest combo first.

Tests

npm run test

tests

About

A Deterministic Finite State Automaton (DFSA) is a subset of a Finite State Machine (FSM) that has a finite number of states and transitions between those states. The DFSA is deterministic in that it has exactly one transition for each possible input from a given state. This means that the DFSA will always be in exactly one state at any given time.

About

A Deterministic Finite State Automaton (DFSA) that detects combos in a fighting game.

Topics

Resources

Stars

Watchers

Forks

Languages