Skip to content

Instantly share code, notes, and snippets.

@dividead
Created November 19, 2016 22:56
Show Gist options
  • Save dividead/7fc27e9bc862d281e2b04c37d331ad67 to your computer and use it in GitHub Desktop.
Save dividead/7fc27e9bc862d281e2b04c37d331ad67 to your computer and use it in GitHub Desktop.
import System.Environment
influx = 590
total = 730
delta = total - influx
x = [[630,470,590,-550,-610],
[370,380,420,-330,-460],
[290,310,160,-240,-360],
[150,90,160,-60,-160],
[20,60,10,-20,-30]]
c = [[i1, i2, i3, i4, i5] |
i1 <- x !! 0,
i2 <- x !! 1,
i3 <- x !! 2,
i4 <- x !! 3,
i5 <- x !! 4,
sum [i1, i2, i3, i4, i5] == delta]
main :: IO ()
main = do
print c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment