Guess my Number - Code Golf The puzzle is as follows:

Create the traditional 'Guess my Number' game in as little keystrokes as possible. The player should input a guess between and including 1 and 100, and the computer should reply with either + (meaning the player needs to guess higher), - (meaning the player needs to guess lower) or = (meaning the player has guessed the number. The game continues until the player has guessed the number. The number that the computer generates MUST be a random number between and including 1 and 100.

Sample gameplay

50
+
75
-
60
-
55
+
57
=


Happy Golfing!
Ruby: 63 58 52 49 characters

puts"=-+"[r=$_.to_i&lt;=&gt;n||=1+rand(100)];r==0&amp;&amp;exit


Sample run:

bash-4.2$ ruby -ne 'puts"=-+"[r=$_.to_i&lt;=&gt;n||=1+rand(100)];r==0&amp;&amp;exit'
50
-
25
+
37
+
43
-
40
+
42
=