Skip to content

Instantly share code, notes, and snippets.

@WhiteCat6142
Created February 4, 2019 13:16
Show Gist options
  • Save WhiteCat6142/8ad00596e6a5fb0620f4f9921f3b16e9 to your computer and use it in GitHub Desktop.
Save WhiteCat6142/8ad00596e6a5fb0620f4f9921f3b16e9 to your computer and use it in GitHub Desktop.
import Control.Monad
import System.IO
main=setting>>zipWithM ask q a>>=print.jug.sum
setting=hSetBuffering stdin NoBuffering>>hSetBuffering stdout NoBuffering
ask x y =print x>>getChar>>=return.fromEnum.(==y)
jug n |n >= 8 = "You win!"
|otherwise="You lose"
q = ["Q1","Q2","Q3","Q4","Q5","Q6","Q7","Q8","Q9","Q10"]
a = "1234123412"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment