Created
February 4, 2019 13:16
-
-
Save WhiteCat6142/8ad00596e6a5fb0620f4f9921f3b16e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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