evaluate :: NNet -> Player -> Board -> M.Map Player (Double,Double)
evaluate nn p b = let
  playing = whichPlayersFrom p b
  everyoneLost = M.fromList $ zip [Red .. Blue]  $ repeat (0,0)
  nnInputs = mapBoard p b
  nnOutputs = feedforward nn nnInputs
  outputPairs = op nnOutputs where
    op (a:b:r) = (a,b) : op r
    op _ = []
  outputPairs' = case length playing of
    2 -> map (\(_,v) -> (1,v)) outputPairs
    3 -> outputPairs
    1 -> [(1,1)]
  in M.union (M.fromList $ zip playing outputPairs') everyoneLost
evaluate :: NNet -> Player -> Board -> M.Map Player (Double,Double)
evaluate nn p b = let
  playing = whichPlayersFrom p b
  everyoneLost = M.fromList $ zip [Red .. Blue]  $ repeat (0,0)
  nnInputs = mapBoard p b
  nnOutputs = feedforward nn nnInputs
  outputPairs = op nnOutputs where
    op (a:b:r) = (a,b) : op r
    op _ = []
  outputPairs' = case length playing of
    2 -> map (\(_,v) -> (1,v)) outputPairs
    3 -> outputPairs
    1 -> [(1,1)]
  in M.union (M.fromList $ zip playing outputPairs') everyoneLost
evaluate nn p b = let
  playing = whichPlayersFrom p b
  everyoneLost = M.fromList $ zip [Red .. Blue]  $ repeat (0,0)
  nnInputs = mapBoard p b
  nnOutputs = feedforward nn nnInputs
  outputPairs = op nnOutputs where
    op (a:b:r) = (a,b) : op r
    op _ = []
  outputPairs' = case length playing of
    2 -> map (\(_,v) -> (1,v)) outputPairs
    3 -> outputPairs
    1 -> [(1,1)]
  in M.union (M.fromList $ zip playing outputPairs') everyoneLost