Article View: alt.folklore.computers
Article #322Re: COBOL program
From: nort... Jim Northrup
Date: Thu, 14 Dec 1989 19:34
Date: Thu, 14 Dec 1989 19:34
44 lines
2777 bytes
2777 bytes
In article <5...@enea.se> som...@enea.se (Erland Sommarskog) writes:
>tom reingold (t...@bellcore.com) writes:
>>I heard in the folklore that once a COBOL programmer wrote a program
>> IF I = 1 THEN ADD 1 TO COUNTER.
>> IF I = 2 THEN ADD 2 TO COUNTER.
>I have actually seen such a program. It was not Cobol, but Fortran
>.....................But the sad story was when I went through the
>exams with a teacher at the CS department. (I was only an assisting
>student teacher.) And he said: "It clumsy, but it is correct; it
>would work. We can't disapprove him." He had the final say, but I
>would even less approve that program today.
There was a program written in BASIC for the TRS-80 Model I to assist
with fantasy role-playing gaming (the "Dungeon Master's Familiar") that
appeared in an early 1980's issue of "Dragon" magazine. The programmer
wanted to generate a random number between 1 and 4 if the user typed
"4", a random number between 1 and 6 if the user typed "6", etc. As I
recall, the code looked like this:
-------------------------------------
def fnr(x) = int(rnd*x) + 1
...
input z$ : z = val(z$)
if z = 4 gosub 100
if z = 6 gosub 200
if z = 8 gosub 300
...
100 a = fnr(4) : return
200 a = fnr(6) : return
300 a = fnr(8) : return
-------------------------------------
Talk about doing things the hard way! And this program didn't just get
turned in as a class assignment, it got published! I remember typing it
in to my old C-64 (translating to C-basic at the same time), and getting
to that section of code. I was stunned....
Jim Northrup nort...@wpi.wpi.edu
Assistant Professor, Department of Mathematical Sciences
Worcester Polytechnic Institute, Worcester MA 01609
I wish I could hear the soundtrack to my life. Then I would know when to duck.
--
Jim Northrup nort...@wpi.wpi.edu
Assistant Professor, Department of Mathematical Sciences
Worcester Polytechnic Institute, Worcester MA 01609
I wish I could hear the soundtrack to my life. Then I would know when to duck.
Technical Details
Message-ID:
<6291@wpi.wpi.edu>Path:
mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!usc!wuarchive!mit-eddie!mit-amt!snorkelwacker!spdcc!merk!xylogics!cloud9!jjmhome!m2c!wpi!northrupReferences:
<18494@bellcore.bellcore.com> <552@enea.se>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!usc!wuarchive!mit-eddie!mit-amt!snorkelwacker!spdcc!merk!xylogics!cloud9!jjmhome!m2c!wpi!northrup From: nort...@wpi.wpi.edu (Jim Northrup) Newsgroups: alt.folklore.computers Subject: Re: COBOL program Message-ID: <6291@wpi.wpi.edu> Date: 14 Dec 89 19:34:29 GMT References: <18494@bellcore.bellcore.com> <552@enea.se> Reply-To: nort...@wpi.wpi.edu (Jim Northrup) Organization: Worcester Polytechnic Institute, Worcester ,MA Lines: 44 Posted: Thu Dec 14 20:34:29 1989 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit