{Actions}=require('flatnet')
Actions are a named list of functions applied to flatnet models
Actions.New(ptr_count=2)
ptr_count
sets the length ofactions
- returns a new array of 2D arrays:
[[name,function],...]
- Simple command line functionality
- Also accessed by
node flatnet.js actions
, see flatnet command line - If args = 0, will print and return
actions.length
- If args > 0, will print names of actions by integer lookup
ptr_count=2
- Flag that can be entered any place after the first two arguments
- Any integer
- Returns action array
//default ptr_count=2
~> node actions.js
actions.length: 98
~> node actions.js 0 1 2 3 4
[0] if_true:o0
[1] if_true:o1
[2] if_false:o0
[3] if_false:o1
[4] o_increment:o0
//with ptr_count flag
~> node actions.js ptr_count=1
actions.length: 42
~> node actions.js "0,1,2,3,4" ptr_count=1
[0] if_true:o0
[1] if_false:o0
[2] o_increment:o0
[3] o_decrement:o0
[4] o_to_0:o0