title: Guard inside 'do' block - haskell
body: <p>I want to write a simple game "guess number" - with <code>n</code> attempts. I want to add some conditions and hits. Is it possible to use <em>guards</em> inside <code>do</code> block ?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>game = return()
  game n = do putStrLn "guess number: 0-99"
              number&lt;-getLine
              let y = read number
              let x =20
              | y&gt;x = putStrLn "your number is greater than x"
              | y&lt;x = putStrLn "your number is less than x"
              | y==x  putStrLn "U win!!"
              | otherwise = game (n-1)
  </code></pre>
  
  <p>already got error </p>
  
  <pre><code>error: parse error on input ‘|’
  </code></pre>
  
  <p>Is it fixable with some <em>white space</em>, or just impossible to do?</p>