2->M pi/4->C Lbl 4 Menu("SNAKE","PLAY",1,"PREFERENCES",2,"QUIT",3) Lbl2 ClrHome Disp "SPEED" Prompt M Disp "TURN ANGLE" Prompt C pi*C/180->C Goto 4 Lbl 1 Radian 0->X 0->Y 2->L pi/2->Theta 0->R 0->D 0->E 0->F 1->N cos(Theta)*M->S sin(Theta)*M->T 0->L1(1) 0->L1(2) 0->L2(1) 0->L2(2) AxisOff ZStandard ZSquare While X>-15.16129 and X<15.16129 and Y>-10 and Y<10 getKey->K If K=45 Goto 4 If K=24 Then cos(Theta+C)*M->S sin(Theta+C)*M->T C->R End If K=26 Then cos(Theta-C)*M->S sin(Theta-C)*M->T -C->R End If not(K=24) and not(K=26) 0->R Theta+R->Theta Line(X, Y, X+S, Y+T) X+S->X Y+T->Y (N+1)-int((N+1)/L)*L->A If L1(A+1)=-1 0->A (N+2)-int((N+2)/L)*L->B If L2(B+1)=-1 0->B Line(L1(A+1), L2(A+1), L1(B+1), L2(B+1), 0) (N+1)-int((N+1)/L)*L->N X->L1(N+1) Y->L2(N+1) If abs(X-E)<1.5 and abs(Y-F)<1.5 Then 0->D L+1->L -1->L1(L) -1->L2(L) Pt-Off(E,F) End If D=0 Then randInt(-140,140)/10->E randInt(-90,-90)/10->F Pt-On(E,F) 1->D End End Goto 4 Lbl 3 ClrDraw ClrHome