Jump to content

Guess the number/With feedback: Difference between revisions

Line 1,030:
</pre>
 
=={{header|Tiny Craft Basic}}==
<syntaxhighlight lang="basic">10title cls"hilo"
 
20 let r = int: (rnd) * 100 + 1
 
30 print "hilo game"
40 print "guess the nusmbernumber between 1 and 100"
 
50 remlabel loop
 
60 let t = t + 1
 
70 input "guess: Guess", g
 
80 if g <>= r then 110
 
90 printalert "you guessed it in ", t ," tries."
end
100 goto 220
 
110 rem endif
 
120 if g >= r1 orand g <= 1100 then 140
 
130if printg "too< low"r then
 
alert "too low"
140 rem endif
 
endif
150 if g < r or g > 100 then 170
 
160if printg "too> high"r then
 
alert "too high"
170 rem endif
 
endif
180 if g >= 1 and g <= 100 then 200
 
140 rem endif
190 print "invalid guess"
 
150 if g < r1 or g > 100 then 170
200 rem endif
 
190 printalert "invalid guess"
210 if g <> r then 50
 
170 rem endif
220 shell "pause"</syntaxhighlight>
 
220if shellg "pause"<> r then loop</syntaxhighlight>
 
=={{header|Crystal}}==
305

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.