Use grid when creating block debris

This commit is contained in:
2022-07-13 10:44:18 +01:00
parent 1ccb87ff13
commit 6c50021f04
12 changed files with 139 additions and 65 deletions
+4
View File
@@ -9,6 +9,7 @@ module ListHelp
, errorHead
, foldPairs
, loopPairs
, slideWindow
) where
import Data.List
@@ -61,3 +62,6 @@ safeUncons _ = Nothing
errorHead :: String -> [a] -> a
errorHead _ (x:_) = x
errorHead s [] = error s
slideWindow :: Int -> [a] -> [[a]]
slideWindow n = foldr (zipWith (:)) (repeat []) . take n . tails