: checkGuess ( gn-gf || f )
  over = [ drop 0 ] [ "Sorry, try again!\n" puts -1 ] if ;

: think ( -n )
  random abs 10 mod 1+ ;

: guess ( - )
  "I'm thinking of a number between 1 and 10.\n" puts
  "Try to guess it!\n" puts
  think [ getNumber checkGuess ] while
  "You got it!\n" puts ;

