battleship-combinatorics-0.0.0.1: Compute number of possible arrangements in the battleship game

Safe HaskellSafe
LanguageHaskell98

Combinatorics.Battleship.Fleet

Contents

Synopsis

basics

data T Source #

Efficient representation of a (Map ShipSize NumberOfShips).

This is known as SIMD within a register https://en.wikipedia.org/wiki/SWAR.

Instances

Eq T Source # 

Methods

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

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

Ord T Source # 

Methods

compare :: T -> T -> Ordering #

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

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

(>) :: T -> T -> Bool #

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

max :: T -> T -> T #

min :: T -> T -> T #

Show T Source # 

Methods

showsPrec :: Int -> T -> ShowS #

show :: T -> String #

showList :: [T] -> ShowS #

Semigroup T Source # 

Methods

(<>) :: T -> T -> T #

sconcat :: NonEmpty T -> T #

stimes :: Integral b => b -> T -> T #

Monoid T Source # 

Methods

mempty :: T #

mappend :: T -> T -> T #

mconcat :: [T] -> T #

Arbitrary T Source # 

Methods

arbitrary :: Gen T #

shrink :: T -> [T] #

Storable T Source # 

Methods

sizeOf :: T -> Int #

alignment :: T -> Int #

peekElemOff :: Ptr T -> Int -> IO T #

pokeElemOff :: Ptr T -> Int -> T -> IO () #

peekByteOff :: Ptr b -> Int -> IO T #

pokeByteOff :: Ptr b -> Int -> T -> IO () #

peek :: Ptr T -> IO T #

poke :: Ptr T -> T -> IO () #

cumulate :: T -> T Source #

lookup (cumulate fleet) size returns the number of all ships that are at least size squares big.

dec :: ShipSize -> T -> T Source #

inc :: ShipSize -> T -> T Source #

subset :: T -> T -> Bool Source #

configurations for some established versions

tests