Guess the number/With feedback: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 1,030: | Line 1,030: | ||
</pre> |
</pre> |
||
=={{header| |
=={{header|Craft Basic}}== |
||
<syntaxhighlight lang="basic"> |
<syntaxhighlight lang="basic">title "hilo" |
||
let r = int: (rnd) * 100 + 1 |
|||
print "hilo game" |
|||
print "guess the number between 1 and 100" |
|||
label loop |
|||
let t = t + 1 |
|||
input "Guess", g |
|||
if g = r then |
|||
alert "you guessed it in ", t ," tries." |
|||
end |
|||
100 goto 220 |
|||
endif |
|||
if g >= 1 and g <= 100 then |
|||
if g < r then |
|||
alert "too low" |
|||
⚫ | |||
endif |
|||
⚫ | |||
if g > r then |
|||
alert "too high" |
|||
⚫ | |||
endif |
|||
180 if g >= 1 and g <= 100 then 200 |
|||
⚫ | |||
⚫ | |||
⚫ | |||
200 rem endif |
|||
⚫ | |||
210 if g <> r then 50 |
|||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Crystal}}== |
=={{header|Crystal}}== |