Guess the number/With feedback: Difference between revisions
→{{header|Frink}}
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 1,780:
34 is correct! Well guessed!
</pre>
=={{header|FTCBASIC}}==
<syntaxhighlight lang="basic">define try = 0, tries = 0, rnd = 1
gosub intro
label seed
onkey gotseed
+1 rnd
if rnd >= 100 then
let rnd = 1
endif
goto seed
label gotseed
cls
print "Guess the number between 1 and 100"
bell
do
+1 tries
input try
if try = rnd then
print "You guessed the number!"
print "Tries: " \
print tries
crlf
print "Enter 0 to play again or 1 to EXIT to DOS"
input try
if try = 0 then
0 tries
gosub intro
goto seed
endif
end
endif
if try > rnd then
print "Try lower..."
endif
if try < rnd then
print "Try higher..."
endif
loop
end
sub intro
cls
print "Hilo game"
crlf
print "Press any key to play..."
return</syntaxhighlight>
=={{header|Genie}}==
|