CompuServe Messages

More BASIC to C

    10-Nov-92 21:14:50
Sb: More BASIC to C
Fm: Al Saveriano 72616,2232
To: All
Ok, Here is another BASIC to C conversion problem I'm having trouble with. How would you convert this to C? L(J,I)=A(L(J,I-1)K) Where L and A are dimensioned arrays DIM L(5,12) and DIM A(9,3) and I,J and K are integers. The actual piece of code goes like this: 100 FOR I = 2 TO 12 110 FOR J = 1 TO 5 120 K=INT(3*RND(1)+1) 130 L(J,I)=A(L(J,I-1),K) 140 IF L(J,I)=0 THEN 120 150 NEXT J,I I've converted over 230 lines so far but I'm still stuck on several of these ugly things. Thanks for any assistance, – al saveriano –