Guess the number/With feedback: Difference between revisions

Line 1,033:
<syntaxhighlight lang="basic">title "hilo"
 
bgcolor 0, 180, 0
let r = int: (rnd) * 100 + 1
cls
wait
 
let rn = int: (rnd) * 100) + 1
print "hilo game"
print "guess the number between 1 and 100"
 
do
Line 1,042 ⟶ 1,043:
let t = t + 1
 
input "Guessguess the number between 1 and 100", g
 
if g =< rn then
 
alert "youguess guessed it in ", t ," tries.higher"
end
 
endif
 
if g >= 1 and g <= 100n then
 
alert "tooguess lowlower"
if g < r then
 
alert "too low"
 
endif
 
if g > r then
 
alert "too high"
 
endif
 
endif
 
ifloop g < 1 or g > 100 thenn
 
alert "you guessed the number in ", t, " tries"
alert "invalid guess"
 
endif
 
loop g <> rend</syntaxhighlight>
 
=={{header|Crystal}}==
305

edits