Skip to content

spakin/choose

Repository files navigation

choose

Build Status Go project version Go Report Card GoDoc

Introduction

choose is a small package for the Go Programming Language that produces all combinations of M out of N items. The core part of the code is based on Matthew Belmonte's C implementation of Phillip J. Chase's Algorithm 382: Combinations of M out of N Objects.

Installation

The choose package has opted into the Go module system so installation is in fact unnecessary if your program or package has done likewise. Otherwise, a traditional

go get github.com/spakin/choose

will install the package.

Documentation

See the choose API reference for details, but the basic usage model is to invoke a function that accepts a slice and returns a channel, then iterate over that channel's contents, each of which is a slice of the same type as the input.

Author

Scott Pakin, scott+choose@pakin.org

About

Go package for choosing M out of N items

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages