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

Safe Haskell Safe Haskell98

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 # Instance detailsDefined in Combinatorics.Battleship.Fleet Methods(==) :: T -> T -> Bool #(/=) :: T -> T -> Bool # Source # Instance detailsDefined in Combinatorics.Battleship.Fleet 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 # Instance detailsDefined in Combinatorics.Battleship.Fleet MethodsshowsPrec :: Int -> T -> ShowS #show :: T -> String #showList :: [T] -> ShowS # Source # Instance detailsDefined in Combinatorics.Battleship.Fleet Methods(<>) :: T -> T -> T #stimes :: Integral b => b -> T -> T # Source # Instance detailsDefined in Combinatorics.Battleship.Fleet Methodsmempty :: T #mappend :: T -> T -> T #mconcat :: [T] -> T # Source # Instance detailsDefined in Combinatorics.Battleship.Fleet Methodsshrink :: T -> [T] # Source # Instance detailsDefined in Combinatorics.Battleship.Fleet 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).