Guess the number/With feedback: Difference between revisions

Added Arturo implementation
No edit summary
(Added Arturo implementation)
Line 274:
end repeat
end run</lang>
 
=={{header|Arturo}}==
 
<lang rebol>n: random 1 10
while ø [
try? [
num: to :integer input "Guess the number: " n
case [num]
when? [=n][print "\tWell Guessed! :)", exit]
when? [>n][print "\tHigher than the target..."]
when? [<n][print "\tLess than the target..."]
else []
]
else -> print "\tInvalid input!"
]</lang>
 
{{out}}
 
<pre>Guess the number: 3
Less than the target...
Guess the number: 9
Higher than the target...
Guess the number: something
Invalid input!
Guess the number: 5
Less than the target...
Guess the number: 7
Well Guessed! :)</pre>
 
=={{header|AutoHotkey}}==
1,532

edits