Guess the number/With feedback: Difference between revisions
Content added Content deleted
No edit summary |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 274: | Line 274: | ||
end repeat |
end repeat |
||
end run</lang> |
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}}== |
=={{header|AutoHotkey}}== |