badu / choose

Go package for choosing M out of N items

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%