module Game.Debug where

import Data.Bits
import Data.List
import Numeric

newtype Hex a = Hex { bless :: a }
instance (Integral a, Show a) => Show (Hex a) where
  show (Hex a) = showHex a ""

newtype BitBoard a = BitBoard a
instance (Bits a) => Show (BitBoard a) where
  show (BitBoard v) = intercalate "\n" $ map row [7,6..0] where
    row r = map (cell r) [0..7]
    cell r f | testBit v (r*8+f) = 'o'
             | otherwise = '.'