Doug Hoffman wrote: KrishnaMyneni wrote: Doug Hoffman wrote: This might also be a problem: fvariable x ^^^^^^^^^^^ : FirePhasers ( -- ) ... cr ." ...x f@ f. 56.000000 ok : t #in X ! ; t 6 x f@ f. 0.000000 \ <= ???? x @ . 6 ok -Doug Krishna
KrishnaMyneni wrote: Doug Hoffman wrote: This might also be a problem: fvariable x ^^^^^^^^^^^ : FirePhasers ( -- ) ... cr ." NUMBER OF UNITS TO FIRE " #in X ! ^^^ e @ X @ - 0 = UNTIL X @ IF X @ negate e +! d{ 7 } f@ f0< IF X @ f ran0 f* ...
On 20 sep, 01:19, KrishnaMyneni <krishnamyn...@bellsouth.net> wrote: There may be some other bug then. I remember explicitly deciding to keep the original Basic indices, and not subtracting 1, so that I wouldn't get confused between the Basic origin and the FSL array origin -- you will not find "{ 0" as a pattern in the file. Sacrificing one element, or one ...
The Beez' wrote: On 19 sep, 19:32, KrishnaMyneni <krishnamyn...@ccreweb.org> wrote: I will take a closer look at the code presently. But the ... condition. Please increase the alloted array size for the array n{. Krishna, I have done that already, but that doesn't seem the... Can you please send me your output, and I'll see if I can reproduce it? Krishna
On 19 sep, 19:32, KrishnaMyneni <krishnamyn...@ccreweb.org> wrote: I will take a closer look at the code presently. But the array/matrix stuff is lifted from the ..., this would be an out of bounds condition. Please increase the alloted array size for the array n{. Krishna, I have done that already, but that doesn't seem the problem. The array is used in this ...
The Beez' wrote: Krishna, Are you SURE this is correct? I think this goes out of bounds for the n{ array! ... Thanks to Hans and Doug, for finding and pointing out two long-standing bugs in strek. I have corrected these and uploaded a revised strek.fs file to ftp://ccreweb.org/software/gforth/ KM
... CONTROL REPORT: "; 2840 PRINTTAB(8);:R1=I:GOSUB8790:PRINTG2$;" REPAIR COMPLETED." 2880 NEXTI:IFRND(1)>.2THEN3070 2910 R1=FNR(1):IFRND(1)>=.6THEN3000 2930 D(R1)=D(R1)-(RND(1)*5+1):PRINT"DAMAGE CONTROL REPORT: "; 2960 GOSUB8790:PRINTG2$;" DAMAGED":PRINT:GOTO3070 ... Really! No spaces, and nearly a thousand lines of this with GOTOs everywhere! Thanks for finding the bug. Krishna
... ( there may be more uses of @ and ! with x ) -Doug This is not likely to be a problem as "x" is probably a temporary fvariable, and use of "@" and "!" will not cause memory problems. The problem with the variable "d1" from your earlier message is serious. I'm looking back through the original BASIC sphagetti to find the source of that problem. Thanks! Krishna
The Beez' wrote: Krishna, Are you SURE this is correct? I think this goes out of bounds for the n{ array! ---8<--- 3 INTEGER array n{ : LongRangeSensors ( -- ) d{ 3... of zero, so if I allocated an array with 3 elements, and used an index of 3, this would be an out of bounds condition. Please increase the alloted array size for the array n{. Regards, Krishna
The Beez' wrote: Krishna, Are you SURE this is correct? I think this goes out of bounds for the n{ array! ---8<--- 3 INTEGER array n{ : LongRangeSensors ( -- ) d{ 3 } f@ f0< IF cr ." LONG RANGE SENSORS ARE INOPERABLE" ELSE cr ." LONG RANGE SCAN FOR QUADRANT " q1 ? ." ," q2 ? cr ." ------------" cr q1 @ 2 + q1 @ 1- DO ...