title: What's wrong with this "Guess my number" batch game?
body: <p>I wrote this game. it simply sets a random number between 1 and 16 and the user must guess it. when the guess was correct, it shows the attempt count to the user. </p>
  
  <p>But when I run it and enter a number, it displays an error and the close immediately. I think the error says missing something.</p>
  
  <pre><code>@echo off
  color 0A
  
  set /a key = %random% / 2048
  set /a attempts=0
  
  title Guess My Number (0 to 16)
  
  :AGAIN
  set /p in = Guess it.
  set /a in = %in%
  
  if %key% GTR %in% (
  echo My Number is greater.
  set /a attempts=%attempts%+1
  goto again
  )
  
  if %key% LSS %in% (
  echo My Number is less.
  set /a attempts=%attempts%+1
  goto again
  )
  
  if %key% == %in% (
  echo right!
  echo You Guessed it in %attempts% attempts.
  goto end
  )
  
  :end
  pause
  </code></pre>