Code: Select all
''bluatigro 14 jun 2017
''higher lower ai
print "think of a number between 1 and 100 ."
dim as string in
input "[ pres return to continue . ]" ; in
dim as integer high = 100 , low = 0 , gok
while left( in , 1 ) <> "g"
gok = int( ( low + high ) / 2 )
print
print "i think of : " ; gok
input "is that good , lower or higher than yours ? [ g l h ] : " ; in
in = left( lcase( in ) , 1 )
if in = "l" then
low = gok
end if
if in = "h" then
high = gok
end if
wend
print "[ game over : pres return to end program ]"
sleep