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

Combinatorics.Battleship.Fleet

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

 Source # Methods(==) :: T -> T -> Bool #(/=) :: T -> T -> Bool # Source # Methodscompare :: T -> T -> Ordering #(<) :: T -> T -> Bool #(<=) :: T -> T -> Bool #(>) :: T -> T -> Bool #(>=) :: T -> T -> Bool #max :: T -> T -> T #min :: T -> T -> T # Source # MethodsshowsPrec :: Int -> T -> ShowS #show :: T -> String #showList :: [T] -> ShowS # Source # Methodsmempty :: T #mappend :: T -> T -> T #mconcat :: [T] -> T # Source # Methodsshrink :: T -> [T] # Source # MethodssizeOf :: 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 () #

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

The main configuration given in https://de.wikipedia.org/wiki/Schiffe_versenken.

The main configuration given in https://en.wikipedia.org/wiki/Battleship_(game).