Merge: doc: fixed some typos and other misc. corrections
[nit.git] / examples / rosettacode / guess_the_number.nit
1 #!/usr/bin/env nit
2 #
3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
5
6 # Task: guess the number
7 # SEE: <http://rosettacode.org/wiki/Guess_the_number>
8
9 var random = 10.rand +1
10 loop
11 print "enter a guess :"
12 if sys.stdin.eof then return
13 var guess = gets.to_i
14 if guess == random then
15 print "Well guessed"
16 break
17 end
18 end