Fix tile drawing bug

This commit is contained in:
2021-10-04 17:20:18 +01:00
parent a6a3841d36
commit cab8c25610
5 changed files with 25 additions and 9 deletions
+6
View File
@@ -4,6 +4,7 @@ module Dodge.Graph
, incidenceToFunction
, pairsToIncidence
, graphToEdges
, graphToIncidence
) where
-- this deserves tests
import Data.List.Extra
@@ -34,3 +35,8 @@ graphToEdges :: forall a b . F.Gr a b -> [(a,a)]
graphToEdges g = map (bimap f f) $ F.edges g
where
f n = fromJust . lookup n $ F.labNodes g
graphToIncidence :: forall a b . F.Gr a b -> [(a,Int)]
graphToIncidence g = map f $ F.labNodes g
where
f (n,p) = (p,length $ F.neighbors g n)