Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
This tool generates all non-repeating permutations for the given input string.
Go
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
CONTRIBUTORS
LICENSE
README.md
main.go
word.go

README.md

Permute

  • Generates all non-repeating permutations for the given input string.
  • Calculate the number of permutations a given input string will yield without actually performing the permutations. It does this through some factorial math.
  • Calculates a rough estimate of how many nanoseconds it will take to yield all permutations. Note that this is not very accurate for short input strings.
  • Input string can be supplied through a commandline argument, or piped in through stdin.
  • Input string is expected to be a set of utf-8 runes.

Usage

go get github.com/jteeuwen/permute

Yield all permutations for 'abc'.

$ permute -w abc

Same as above, but input supplied through a pipe.

$ echo -n "abc" | permute

Calculate the number of permutations this string will yield.

$ permute -w abc -c

Calculate average number of nanoseconds it will take to yield all permutations.

$ permute -w abc -t

License

Unless otherwise stated, all of the work in this project is subject to a 1-clause BSD license. Its contents can be found in the enclosed LICENSE file.

Something went wrong with that request. Please try again.