0 Members and 1 Guest are viewing this topic.
.SDKUSVZ#Realloc(L1)0->X0->Y0->A0->B[0042241818244200]->Pic2[0000000000000000007E6E4E6E467E0000423C724E3E000000427C427C7C4200005A5A407A7A7A0000003E027C7C020000403E3E023C420000007872664E1E0000423C423C3C420000403C3C407C7C00]->Pic1Buff(81)->GGoto MAINprgmSTACKLIBLbl DISPClrDraw^^r^^rFor(A,0,9Line(0,7*A,63,7*A)Line(7*A,0,7*A,63)EndFor(A,0,8For(B,0,8If {9*B+G+A}Pt-On(7*A,7*B,{9*B+G+A}*8+Pic1)^^rEndEndEndPt-On(7*X,7*Y,Pic2)DispGraph^^rReturnLbl MAINRepeat getKey(9)DISP()If getKey(4)?Y!=0Y-1->YEndIf getKey(1)?Y!=8Y+1->YEndIf getKey(2)?X!=0X-1->XEndIf getKey(3)?X!=8X+1->XEndIf getKey(33)0->{9*Y+X+G}EndIf getKey(34)1->{9*Y+X+G}EndIf getKey(35)4->{9*Y+X+G}EndIf getKey(36)7->{9*Y+X+G}EndIf getKey(26)2->{9*Y+X+G}EndIf getKey(27)5->{9*Y+X+G}EndIf getKey(28)8->{9*Y+X+G}EndIf getKey(18)3->{9*Y+X+G}EndIf getKey(19)6->{9*Y+X+G}EndIf getKey(20)9->{9*Y+X+G}EndIf getKey(15)For(N,0,80)0->{G+N}EndEndIf getKey(55)Return^^rEndEnd0->L0->Msub(BACKTRACK)Disp "Solve complete!",[i]Disp T>DecGoto MAINLbl ISFULLFor(X,0,8For(Y,0,8If {9*Y+X+G}=00->TReturnEndEndEnd1->TReturnLbl GETNEXTWhile {9*M+L+G}!=0?M!=9L++If L=90->LM++EndEndReturnLbl COLLISIONIf L<30->AElseIf L<63->AElse6->AEndIf M<30->BElseIf M<63->BElse6->BEndFor(X,0,8)If {9*M+X+G}!=0If X!=LIf {9*M+X+G}={9*M+L+G}1->TReturnEndEndEndIf {9*X+L+G}!=0If X!=MIf {9*X+L+G}={9*M+L+G}1->TReturnEndEndEndEndA+2->CB+2->DFor(X,A,C)For(Y,B,D)If {9*Y+X+G}!=0If L!=X??M!=YIf {9*Y+X+G}={9*M+L+G}1->TReturnEndEndEndEndEnd0->TReturnLbl BACKTRACKIf {9*M+L+G}!=0sub(GETNEXT)End1->NWhile N!=10N->{9*M+L+G}sub(COLLISION)If T=0sub(ISFULL)If T=1ReturnEndL++If L=9M++0->LEndsub(PUSH,L1,L)sub(PUSH,L1,M)sub(PUSH,L1,N)sub(BACKTRACK)sub(POP,L1,N)sub(POP,L1,M)sub(POP,L1,L)If T=1ReturnEndL--If L=655358->LM--EndIf L=08->LM--ElseL--EndEndN++End0->{9*M+L+G}0->TReturn
..STACKLIBLbl PUSH{[r1]}^^r+1->{[r1]}^^r{[r2]}^^r->{{[r1]}^^r+1+[r1]}ReturnLbl POPIf {[r1]}^^r>=>=0{{[r1]}^^r+1+[r1]}->{[r2]}^^r{[r1]}^^r-1->{[r1]}^^rElse0->{[r2]}EndReturn
X?GoTo n
ld [address of x],HLcp HLnz jp [address of n]
More optimizations . I finally learned the art of abusing HL, so I applied it to my program. I hope you don't mind that I copied your loop structure , but it shaved about 15% of the time off. I do admit though that because your loop is a decrementing loop, it changed the algorithm a little, but it was worth the speed gain . Nice job finding that loop .
lbl something..code goes hereconditionalasm(3E00BEC2(L(list token)something))
nlbl something-1->X..code goes hereXasm(3E00BEC2(L(list token)something))