UNPKG

chopsuey

Version:

Combinatorics: subsets, permutations, etc.

78 lines (61 loc) 2.54 kB
<div id="top"></div> [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url] <br /> <div align="center"> <!-- <a href="https://github.com/othneildrew/Best-README-Template"> <img src="images/logo.png" alt="Logo" width="80" height="80"> </a> --> <h3 align="center">Chop Suey</h3> </div> <!-- ABOUT THE PROJECT --> ## About The Project Chop Suey 杂碎 is a stir-fried vegetable dish usually with meat or seafood. In honor of such wonderful food, this npm package is built to imitate the elegant mixing and matching of its ingredients through the functions in combinatorics. This includes: * Subsets * Permutations * Shuffle <p align="right">(<a href="#top">back to top</a>)</p> ### Installation ```sh npm i chopsuey ``` <p align="right">(<a href="#top">back to top</a>)</p> <!-- USAGE EXAMPLES --> ## Usage ```js import ChopSuey from 'ChopSuey'; ... for(const subset of Chopsuey.generateSubsets(array)) { ... } ... ``` ```js import ChopSuey from 'ChopSuey'; ... const subsets = Chopsuey.geSubsets(array); ... ``` <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> [contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge [contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors [forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge [forks-url]: https://github.com/othneildrew/Best-README-Template/network/members [stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge [stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers [issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge [issues-url]: https://github.com/othneildrew/Best-README-Template/issues [license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge [license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 [linkedin-url]: https://linkedin.com/in/othneildrew [product-screenshot]: images/screenshot.png