Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Junior
01 INPUT "What's your name?", $x
02 PRINT $x is a stupid name!
03 INPUT "Are you a creationist?", $y
04 IF $y="yes" GOTO 10
05 IF $y="no"
06 PRINT Well, $x is still a stupid name!
06 END
10 PRINT You're a flaming idiot!
11 GOTO 10

127 posted on 11/15/2005 7:10:58 PM PST by PatrickHenry (Expect no response if you're a troll, lunatic, retard, or incurable ignoramus.)
[ Post Reply | Private Reply | To 124 | View Replies ]


To: PatrickHenry

You have an endless loop there at the end.


128 posted on 11/15/2005 7:13:34 PM PST by Junior (From now on, I'll stick to science, and leave the hunting alien mutants to the experts!)
[ Post Reply | Private Reply | To 127 | View Replies ]

To: PatrickHenry
Statement 5 could suffer a deletion mutation without loss of function.
130 posted on 11/15/2005 7:16:37 PM PST by VadeRetro (Liberalism is a cancer on society. Creationism is a cancer on conservatism.)
[ Post Reply | Private Reply | To 127 | View Replies ]

To: PatrickHenry; Junior; VadeRetro
Under MS-Basic, at least: The dollar signs go *after* the string variable names. String constants on lines 2, 6, and 10 are missing the necessary quote characters. Line 5 is a syntax error (needs a "GOTO" or "THEN" clause after the "IF" test). Line 5 is redundant anyway, since it's the fall-through from the comparison to "yes" on the prior line. There are two lines numbered 6, which will cause the first one to be replaced by the second one, thus the program will silently exit if the user responds to the question with anything other than "yes".

On the other hand, the infinite print loop appears to be a feature, not a bug.

137 posted on 11/15/2005 11:49:38 PM PST by Ichneumon
[ Post Reply | Private Reply | To 127 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson