combinatorial-0.1.0.1: Count, enumerate, rank and unrank combinatorial objects

Safe HaskellSafe
LanguageHaskell98

Combinatorics.Mastermind

Synopsis

Documentation

data Eval Source #

Cf. board-games package.

Constructors

Eval 

Fields

Instances
Eq Eval Source # 
Instance details

Defined in Combinatorics.Mastermind

Methods

(==) :: Eval -> Eval -> Bool #

(/=) :: Eval -> Eval -> Bool #

Ord Eval Source # 
Instance details

Defined in Combinatorics.Mastermind

Methods

compare :: Eval -> Eval -> Ordering #

(<) :: Eval -> Eval -> Bool #

(<=) :: Eval -> Eval -> Bool #

(>) :: Eval -> Eval -> Bool #

(>=) :: Eval -> Eval -> Bool #

max :: Eval -> Eval -> Eval #

min :: Eval -> Eval -> Eval #

Show Eval Source # 
Instance details

Defined in Combinatorics.Mastermind

Methods

showsPrec :: Int -> Eval -> ShowS #

show :: Eval -> String #

showList :: [Eval] -> ShowS #

evaluate :: Ord a => [a] -> [a] -> Eval Source #

Given the code and a guess, compute the evaluation.

evaluateAll :: Ord a => [[a]] -> [a] -> Map Eval Int Source #

numberDistinct :: Int -> Int -> Int -> Int -> Integer Source #

numberDistinct n k b w computes the number of matching codes, given that all codes have distinct symbols. n is the alphabet size, k the width of the code, b the number of black evaluation sticks and w the number of white evaluation sticks.