funcy_perm

0.1.1 • Public • Published

funcy_perm

Take an array, apply a function to all possible combinations.

Install & Use

Shell:

npm install funcy_perm

CoffeeScript:

funcy_perm = require "funcy_perm"

my_arr = [ 0 , 0 , 0 ]

funcy_perm(my_arr).perm ( val, i ) -> 
  val + 1

// returns
[ 
  [ 0, 0, 0 ],
  [ 0, 0, 1 ],
  [ 0, 1, 0 ],
  [ 0, 1, 1 ], 
  
  [ 1, 0, 0 ],
  [ 1, 0, 1 ], 
  [ 1, 1, 0 ], 
  [ 1, 1, 1 ]
]

/funcy_perm/

    Package Sidebar

    Install

    npm i funcy_perm

    Weekly Downloads

    4

    Version

    0.1.1

    License

    BSD

    Last publish

    Collaborators

    • da99