|
Post by basicfreak on Mar 24, 2002 15:27:26 GMT
I am a little new at this and i didn't even finish my tutorols.... and i have been makig this stupid little program and i need help... oh and this program is just for my practice... CLS ? "Can you guess the number I have between 1 and 10?" INPUT "You have three chances" ;a$ IF a$ < 4 THEN PRINT "Too low!" IF a$ > 5 THEN PRINT "Too high!!"
on the line 4 it says that this is a type mismatch ... i don't get it....
|
|
jamppa
Junior Member
DarkAges rules!!!
Posts: 53
|
Post by jamppa on Mar 24, 2002 16:02:55 GMT
I'm not sure (cause i'm a little new too), but i think you have to do it like this:
CLS PRINT "Can you guess the number I have between 1 and 10?" PRINT "You have three chances" INPUT a$ IF a$ < 4 THEN PRINT "Too low!" IF a$ > 5 THEN PRINT "Too high!!"
|
|
pebe
Junior Member
Posts: 39
|
Post by pebe on Mar 24, 2002 18:00:43 GMT
You cannot have a number as a string.
You must input an integer or single or double precision. If you use a variable without its identifier then it defaults to single (eg a = a!)
So change a$ and use IF a% > 4 or IF a > 4
|
|
|
Post by fly@aol.com on Mar 24, 2002 18:54:14 GMT
randomize timer cls print "try to guess the number I'm thinking of, from 1 to 10" print "you get three guesses" original.number = int(10*rnd+1) for x=1 to 3 input "enter a number " ; guess if guess=original.number then print " success" end elseif guess < original.number then print " too low" elseif guess > original.number then print " too high" end if next x print "failure" end
|
|
|
Post by basicfreak on Mar 24, 2002 19:05:48 GMT
Thanx guys!!!
|
|