Tweak twisting when aiming

This commit is contained in:
2021-12-05 16:54:08 +00:00
parent d9c5cfc26d
commit 22e3256da3
30 changed files with 350 additions and 252 deletions
+2 -3
View File
@@ -82,15 +82,14 @@ itemsMultisets = map mconcat . mapM itemMultisets
-- "individual" items can produce multiple multisets if they are in fact
-- a stack of more than one item
itemMultisets :: (Int,Item) -> [([Int],M.Map CombineType Int)]
itemMultisets (i,it) = case it ^? itConsumption . itAmount' of
itemMultisets (i,it) = case it ^? itConsumption . itAmount of
Nothing -> [ ([i], M.singleton thetype 1 ) ]
Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n]
where
thetype = _itType it
itemTypeAmounts :: Item -> [[CombineType]]
itemTypeAmounts it = case it ^? itConsumption . itAmount' of
itemTypeAmounts it = case it ^? itConsumption . itAmount of
Nothing -> [[thetype]]
Just i -> map (`replicate` thetype) [1 .. i]
where