Skip to content

Commit

Permalink
Remove debug and calc on input
Browse files Browse the repository at this point in the history
  • Loading branch information
tjpalmer committed Dec 2, 2019
1 parent 56f76ad commit 8154e74
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions 2019/01/sumfueldeep.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Debug.Trace

main = print (findFuelDeep 1969)

mainMore = do
main = do
content <- readFile "sumfuel-input.txt"
let contentLines = lines content
let masses = map (read :: String -> Int) contentLines
Expand All @@ -12,6 +8,6 @@ mainMore = do
findFuel mass = (div mass 3) - 2

findFuelDeep mass
| fuelMass <= 0 = trace ("a " ++ show mass ++ ", " ++ show fuelMass) $ 0
| otherwise = trace ("b " ++ show mass ++ ", " ++ show fuelMass) $ fuelMass + findFuelDeep fuelMass
| fuelMass <= 0 = 0
| otherwise = fuelMass + findFuelDeep fuelMass
where fuelMass = findFuel mass

0 comments on commit 8154e74

Please sign in to comment.