sylvar: (Default)
[personal profile] sylvar
Oh, thank heavens I'm not the only one who noticed the bug in WIRED. Go ahead, read the code and see if you can spot the problem. As a veteran of Atari BASIC, I frowned instantly.

The article, Why Veteran Visionaries Will Save the World (printed as "The Ages of Innovation"), is about chronological age and technology leadership.



Hands up if you spotted the bug.

Date: 2008-10-17 04:07 am (UTC)
From: [identity profile] hitchkitty.livejournal.com
Well, unless I'm greatly mistaken, entering "425" would result in "WELCOME, CEO!"

Date: 2008-10-17 04:23 am (UTC)
From: [identity profile] sylvar.livejournal.com
Son of a bitch... well played!

Hands up if you spotted the *other* bug.

Date: 2008-10-17 11:08 am (UTC)
From: [identity profile] hitchkitty.livejournal.com
Well, I hadn't been entirely sure, but I don't think you can enter a value for A$. Which means the program will always print "SORRY! GOODBYE." immediately after asking for the user's age.

Date: 2008-10-17 02:29 pm (UTC)
From: [identity profile] sylvar.livejournal.com
Right. It should be 10 INPUT "prompt?", A$.

Date: 2008-10-17 11:59 am (UTC)
From: [identity profile] datan0de.livejournal.com
Cripes. I've never programmed on an Atari but did spend an embarrassing percentage of my childhood playing with Commodore 64 BASIC, which is close enough to Atari BASIC to know the difference between PRINT and INPUT.

Also, shouldn't it be "A" instead of "A$"? Can Atari BASIC process a string variable as a numerical value?

Date: 2008-10-17 02:55 pm (UTC)
From: [identity profile] sylvar.livejournal.com
Yes. It should be 20 IF VAL(A$) < 30 THEN GOTO 60.

Date: 2008-10-17 01:32 pm (UTC)
From: [identity profile] srmm.livejournal.com
See, and I looked at it and thought, "I don't know enough about Atari basic to know what's allowable and what's not, or how stuff is interpreted, but it looks ok to me", which is obviously what happened to the poor sod who wrote it.

Date: 2008-10-19 03:37 pm (UTC)
From: [identity profile] hapgood.livejournal.com
shouldn't line 10 be an input statement, not a print statement?

Date: 2008-10-19 10:49 pm (UTC)
From: [identity profile] sylvar.livejournal.com
yup, and there are other problems too -- such as integer/string comparison.

November 2010

S M T W T F S
 123456
78910111213
14151617181920
21222324 252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 16th, 2026 06:35 pm
Powered by Dreamwidth Studios