The other day I started with REDUE22, Which has a " For(J,1,16" loop, that performed as follows:

On the first pass the problem was displayed but when I inputted the correct answer instead of pausing, REDUE22 , as it should, it jumped to the next problem.

On the second pass the process repeated.

On the third pass of the J loop those little dots on the upper right side of the screen kept running. The only way I could stop the running was to shut off the 84.

The first thing I did was {1}-->OVER1. That was to stop the hanging of the 84.
I then checked J on the home screen and it was 17 not 1.

After some thought I decided to put "STOP" in various places in REDUE22 and see where J went from 1 to some other number. To my amazement I discovered that the comments I was putting in the code were causing J to increase. So I reduced the comments to this example:
While 0:3:End

Then I numbered the "While" statements in sequence. I decided I could answer any questions by making a simple Excel spread sheet and explain what was between two sequential numbers for anyone who wanted to know what certain code did.

That left me with just a J value of 2 instead of 1. If I STOP and check the following code as described above then J=1

For(J,1,dim(⌊JONL4
If 3<⌊JONL4(J)
J→⌊JONL5(1+dim(⌊JONL5
End
If I STOP and check the code as described above after the "End" then J=2

Please help me.
One thing I can think of: are you sure that the third line uses JONL5, not JONL4? If it's JONL4, then your infinite loop would come from JONL4 growing inside the loop.
Yes I am sure. I do not have the infinite loop running now. In summary I have J=2 after the first pass of the loop. Before the code referenced J=1 after running the code J=2 Having J=2 after running this code is the bug.

To summarize the code JONL4 can have any value >0.
If that value in JONL4 is >3
Then JONL5 will contain that J value.

To further clarify. If I set up the program so that J can only be 1,3,5,7 ..
Then 2 is illegal in the first pass. Thus when the program runs, I get an error massage when I try to use J in a statement. I am not sure what the error message was but I think it was invalid dim.

I further believe, that we are collectively are getting to the point where the problems are easily explained. Their solutions are not possible for me. I hope & pray that someone somewhere can find a solution.

So the problem in a nutshell, is to design some code that provides this functionally of the discussed code but does not index J

Since we know that J is one value larger each time it passes of that four lines of code. that is when J=1 before passing over the code and 2 after passing over the code I believe this process will continue. So the next value of J is3 before passing over the code and 4 after passing.

Is this just a brain fart or would
J-1-->J
I tried it on the home screen and it seems to work.
To day 1/14 I put a version of SHOWSTUF imbedded in RESUE22. OVER1 in REDUE22 looks like this{1,0,3,0,5,0,7} so values for J of 2 and 4 are illegal if the skipping is done correctly.
SHOWSTUF is shown below. It's function is to display the values shown on each pass of the J loop

ClrHome
Output(1,1,"L4 "
Output(1,5,⌊JONL4
Output(2,1,"L5 "
Output(2,5,⌊JONL5
Output(3,1,"L1 "
Output(3,5,⌊JONL1
Output(4,1,"TWO "
Output(4,5,⌊OVER1
Output(8,1,"JA "
Output(8,5,J
Pause
ClrHome
On each consecutive pass I recorded the values shown below.

Some short hand L4, L5,L1,J
So there we go.
Pass 1
L4 {3}
L5{}
L1{}
J 1
pass two
L4{3,3
L5{}
Li{2}
J 2
pass three
L4{3,3,3,}
L5{}
L1{2}
J 3

pass four
L4 {3,3,3,3}
L5{}
L1 {2,4}
J 4

pass five
L4 {3,3,3,4}
L5{5}
L1{2,4}
J 5.

Some observations about the data. When the program runs the first flash card runs everything is O.K. On the next pass which should be Illegal I get the reversed message. On the third pass which is in the same problem as pass two I get the correct answer. There is a pattern here.
I have no idea what is happening, perhaps some one does or can suggest ways for me to test or upload it to the site so others can work on it.
I found the bug.

J→O
0→dim(⌊JONL5
For(O,1,dim(⌊JONL4
If 3<⌊JONL4(O)
O→⌊JONL5(1+dim(⌊JONL5
End
As you can see I substituted "O" for "J" Very Happy Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement