Hi, community, I'm trying to make a MasterMind game of my own programming, and I came up with an algorithim, but the calc throws an "invalid Dim" error whenever the guess is wrong. I ran the program by hand and on paper up to the error point and can find Nothing wrong. Could you all look at it and see what's wrong?

```
:ClrHome
:ClrDraw
:0->A
:Horiz
:4->dim(L1
:randInt(1,7->L1(1
:randInt(1,7->L1(2
:randInt(1,7->L1(3
:randInt(1,7->L1(4
:{1,5,7,8->L1 // for debugging only; a Prespecified List
:ZStandard
:Vertical 0
:Vertical -.3
:Vertical -5
:Vertical 10
:AxesOff
:Horizontal 10
:Horizontal 5+(1/3
:Horizontal 2/3
:Horizontal -4
:Horizontal -9.6
:Horizontal -9
:Horizontal -10
:For(R,1,8
:DelVar Str1:"_"->Str1
:Disp L1 //For debugging purposes only
:Input L2
:DelVar L4
:DelVar L3
:4->dim(L4
:4->dim(L3
:For(M,1,4
If L2(M)=L1(M
:Then
:Str1+"1->Str1
:1->L3(M
:1->L4(M
:Else
:ForN,1,4
:If N≠M and L4(M=0 and L3(N=0 and L2(N≠L1(N //Here is where it throws an "invalid dim" error if one
number is incorrect in the input as compared to the calc's list.
:Then
:Str1+"0->Str1
:1->L3(N
:1->L4(M
:End
:End
:End
:End
:(R=1)(1)+(R=2)(8)+(R=3)(15)+(R+4)(22)+(R=5)(1)+(R=6)(8)+(R=7)(15)+(R=8)(22)->S
:(R≤4)(0)+(R>4)(73)->U
:Text(S,T,L2(1
:Text(S,T+4,L2(2
:Text(S,T+8,L2(3
:Text(S,T+12,L2(4
:Text(S,U,Str1
:Disp Str1
:If Str1="_1111
:Goto 1
:End
:Lbl 1
:If Str1="_1111
:Then
:Disp "YOU WIN!
:Else
:Disp "YOU LOSE :(
:End
```

You Might Be able to copy/ Paste this into chemtech sourcecoder 3, create a file, edit for syntax, then run in an emulator. I'm using a Ti 83, not a Ti-83+, and I would appreciate help as to what is the problem that throws an error. I ran It on paper, But I could not find anything wrong.