Skip to content

An example of a stateful object built using visual automata-based programming.

License

Notifications You must be signed in to change notification settings

lukaszmakuch/cursed-prince

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains an example model built using visual automata-based programming.

To run it, install the dependencies (npm i) and then simply type npm start.

// Part of the index.js file:
let state;
[
  {type: 'INTRODUCE_YOURSELF'},
  {type: 'EAT', dish: 'yakisoba'},
  {type: 'INTRODUCE_YOURSELF'},
  {type: 'EAT', dish: 'pizza'},
  {type: 'INTRODUCE_YOURSELF'}
].forEach(action => {
  const {state: newState, result} = model({state, action});
  state = newState;
  console.log(result);
});
// I am The Prince of Rosmaro!
// undefined
// I am The Prince of Rosmaro!
// undefined
// Ribbit! Ribbit!

About

An example of a stateful object built using visual automata-based programming.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published