import Twss
main = do
input <- getLine
putStrLn $ show $ isTwss input
putStrLn $ show $ isTwssProbability input -- show the probability of this being a twss
Use demo.hs
to watch it in action:
runhaskell demo.hs
Thinking of using the -XNoMonomorphismRestriction
flag with this code? BAD IDEA, it will grind to a halt. Please don't do it. See here if you don't know what the flag does.
This is a port of DanielRapp's twss.js by Aditya Bhargava.