Richard,
Before you get sick of hanging around I'd like to avail myself of your
expertise regarding a problem at work. At JPL we're running the Lab on
an Oracle-based system (I know, I know...) and we've been trying to
automate many of the business processes such as the hirings and
terminations of employees. Part of my job is to review the underlying
code running on the Oracle servers. The language is a bit arcane, but
quite flexible. Anyway, I've been trying to debug the code that
follows below but the complexities and subtleties have given me a
headache for quite a while. Perhaps you could help.
The program is designed to create a visual representation of an
employee's career movement through JPL.
Part of the problem is that it's based on legacy code from our old
Microsoft-based server and *THAT* was based on an even older system of
unknown origin. There's a few typos but I'll get to fixing them later.
Thanks in advance!
Ozzy
----- Begin Code
1 REM
10 DIM (A11),B(11),G(15,35),G$(4)
11 G$="#+ *"
12 C9=0
15 DIM C(11)
20 MAT G=(0)
25 ;"12>"
30 FOR I=1 TO 35
31 X=RND(-1)
40 G(1,I)=-2\G(15,I)=-2
50 NEXT I
60 FOR I=1 TO 15
70 G(I,1)=-2\G(I,35)=-2
80 NEXT I
85 N9=INT(RND(-1)*4)+5
90 FOR I=1 TO N9
95 C(I)=0
100 X=INT(RND(-1)*13)+2\Y=INT(RND(-1)*33)+2
110 IF G(X,Y)<>0 THEN 100
120 G(X,Y)=-1
125 A(I)=X\B(I)=Y
130 NEXT I
140 FOR I=1 TO N9*INT(RND(-1)*4+3)+INT(RND(-1)*21)
150 X=INT(RND(-1)*13)+2\Y=INT(RND(-1)*33)+2
160 IF G(X,Y)<>0 THEN 150
170 G(X,Y)=-2
180 NEXT I
181 X=INT(RND(-1)*8)+2\Y=INT(RND(-1)*28)+2
182 IF G(X,Y)<>0 THEN 181
183 G(X,Y)=1
184 P=X\P1=Y
200 ;"<25>"
201 FOR I=1 TO 15
210 FOR J=1 TO 35
220 ;G$(G(I,J)+3,G(I,J)+3):
230 NEXT J
240 PRINT
241 PRINT " ":
245 NEXT I
246 GOSUB 3000
248 ON INERR GOTO 310
249 IF C9>0 THEN 400
250 GET LEN(1), USING "MOVE?",M
255 IF M=0 THEN GOTO 9000
260 FOR I=1 TO M
265 READ X,Y
266 NEXT I
267 RESTORE
268 DATA 1,-1,1,0,1,1,0,-1,0,0,0,1,-1,-1,-1,0,-1,1
400 G(P,P1)=0
410 P=P+X\P1=P1+Y
420 IF G(P,P1)<(-1) THEN 1000
421 IF G(P,P1)<0 THEN 2000
430 G(P,P1)=1
450 FOR I=1 TO N9
452 IF C(I)=1 THEN 510
460 G(A(I),B(I))=0
470 A(I)=A(I)+SGN(P-A(I)\B(I)=B(I)+SGN(P1-B(I))
480 IF G(A(I),B(I))<0 THEN C(I)=1
481 IF G(A(I),B(I))<0 THEN G(A(I),B(I))=0
495 IF C(I)=1 THEN 510
500 IF G(A(I),B(I))=1 THEN 2000
505 G(A(I),B(I))=-1
510 NEXT I
515 C9=C9-1
516 IF C9<0 THEN C9=0
520 GOTO 200
1000 GOSUB 5000
1001 ;"** YOU TOUCHED AN UNANIMATED ELECTRICALLY CHARGED OBJECT. **"
1010 GOSUB 8000
1543
2000 GOSUB 5000
2001 ;"**** YOU TOUCHED AN ANIMATED OBJECT PROGRAMED TO KILL ****"
2010 GOSUB 8000
3000 FOR I=1 TO N9
3100 IF C(I)=0 THEN RETURN
3110 G(A(I),B(I))=0
3200 NEXT I
3300 ;"**** YOU WIN YOU LUCKY SUCKER! ****"
3400 GOTO 8000
4800 IF G(A(I),B(I))<0 THEN C(I)=1
5000 ;"<12>"
5010 PRINT
5020 PRINT
5030 PRINT TAB(15);"********** ****
**********"
5035 ;" ":
5040 PRINT TAB(15);" ** ** **
** **"
5045 ;" ":
5050 PRINT TAB(15);" ** **
** ** **"
5055 ;" ":
5060 PRINT TAB(15);" ** ************
**********"
5065 ;" ":
5070 PRINT TAB(15);" ** **
** **"
5075 ;" ":
5080 PRINT TAB(15);" ** **
** **"
5085 ;" ":
5090 PRINT TAB(15);"********** ** **
**"
5100 RETURN
8000 PRINT
8010 GET LEN(1), USING "WANT TO PLAY AGAIN?",G$
8020 IF G$(1,1)="Y" THEN RUN
8025 IF G$(1,1)="N" THEN ;"AW NUTS! YOU CHICKEN!"
8030 END
9000 REM
9005 GET LEN(1), USING "AUTO MOVE DIRECTION?",M
9007 GET LEN(1), USING "HOW MANY MOVES (1-9)?",C9
9010 IF C9<1 THEN 9007
9020 IF M=0 THEN M=5
9029 ;"<12>"
9030 GOTO 260
Received on 2003-12-10 20:15:25
This archive was generated by hypermail 2.3.0
: 2020-02-04 07:16:18 UTC