0 Members and 1 Guest are viewing this topic.
;remember, the king is represented by 5;also remember that the piece type is the 3rd element of the 4 bytes per piece, the 0th being if it's taken or not.5 -> { 7*4 + 3 + L1} ;the p here is 7, the n is 3
.CHESS[3844828282443800]üPic1PCS[387CFEFEFE7C3800]üPic1PCS[3068A4A484483000]üPic1PCS[1058DCDCFC783000]üPic1PCS[609088482848F800]üPic1PCS[60F0F87838787800]üPic1PCS[D6D67C2828287C00]üPic1PCS[D6D67C3838387C00]üPic1PCS[9254382828287C00]üPic1PCS[9254383838387C00]üPic1PCS[3828EE82EE283800]üPic1PCS[3838FEFEFE383800]üPic1PCS[FFFFFFFFFFFFFFFF]üPic319ü{Lƒ+17}15ü{Lƒ+18}20ü{0*4+0+L}1ü{0*4+1+L}27ü{1*4+0+L}1ü{1*4+1+L}34ü{2*4+0+L}1ü{2*4+1+L}41ü{3*4+0+L}1ü{3*4+1+L}48ü{4*4+0+L}1ü{4*4+1+L}55ü{5*4+0+L}1ü{5*4+1+L}62ü{6*4+0+L}1ü{6*4+1+L}69ü{7*4+0+L}1ü{7*4+1+L}20ü{8*4+0+L}8ü{8*4+1+L}27ü{9*4+0+L}8ü{9*4+1+L}34ü{10*4+0+L}8ü{10*4+1+L}41ü{11*4+0+L}8ü{11*4+1+L}48ü{12*4+0+L}8ü{12*4+1+L}55ü{13*4+0+L}8ü{13*4+1+L}62ü{14*4+0+L}8ü{14*4+1+L}69ü{15*4+0+L}8ü{15*4+1+L}50ü{16*4+1+L}ü{17*4+1+L}ü{18*4+1+L}ü{19*4+1+L}ü{20*4+1+L}ü{21*4+1+L}ü{22*4+1+L}ü{23*4+1+L}20ü{16*4+0+L}27ü{17*4+0+L}34ü{18*4+0+L}41ü{19*4+0+L}48ü{20*4+0+L}55ü{21*4+0+L}62ü{22*4+0+L}69ü{23*4+0+L}43ü{24*4+1+L}ü{25*4+1+L}ü{26*4+1+L}ü{27*4+1+L}ü{28*4+1+L}ü{29*4+1+L}ü{30*4+1+L}ü{31*4+1+L}20ü{24*4+0+L}27ü{25*4+0+L}34ü{26*4+0+L}41ü{27*4+0+L}48ü{28*4+0+L}55ü{29*4+0+L}62ü{30*4+0+L}69ü{31*4+0+L}0ü{24*4+3+L}ü{25*4+3+L}ü{26*4+3+L}ü{27*4+3+L}ü{28*4+3+L}ü{29*4+3+L}ü{30*4+3+L}ü{31*4+3+L}1ü{8*4+3+L}ü{9*4+3+L}ü{10*4+3+L}ü{11*4+3+L}ü{12*4+3+L}ü{13*4+3+L}ü{14*4+3+L}ü{15*4+3+L}2ü{2*4+3+L}ü{5*4+3+L}ü{18*4+3+L}ü{21*4+3+L}3ü{1*4+3+L}ü{6*4+3+L}ü{17*4+3+L}ü{22*4+3+L}4ü{0*4+3+L}ü{7*4+3+L}ü{16*4+3+L}ü{23*4+3+L}5ü{3*4+3+L}ü{19*4+3+L}6ü{4*4+3+L}ü{20*4+3+L}Repeat (getKey(15))sub(M)If (0)Lbl MIf ((getKey(3)) and ({Lƒ+17}<68)){Lƒ+17}+7ü{Lƒ+17}Pause 250EndIf ((getKey(2)) and ({Lƒ+17}>20)){Lƒ+17}-7ü{Lƒ+17}Pause 250EndIf ((getKey(4)) and ({Lƒ+18}>1)){Lƒ+18}-7ü{Lƒ+18}Pause 250EndIf ((getKey(1)) and ({Lƒ+18}<48)){Lƒ+18}+7ü{Lƒ+18}Pause 250EndReturnEndIf (getKey(54))For(N,0,31)If (({N*4+0+L}=({Lƒ+17}+1)) and ({N*4+1+L}={Lƒ+18}) and ({N*4+3+L}=0)){N*4+0+L}üZ{N*4+1+L}üÁsub(A)Zü{N*4+0+L}Áü{N*4+1+L}EndEndEndsub(O)If (0)Lbl OClrDrawLine(19,1,19,57)Line(26,1,26,57)Line(33,1,33,57)Line(40,1,40,57)Line(47,1,47,57)Line(54,1,54,57)Line(61,1,61,57)Line(68,1,68,57)Line(75,1,75,57)Line(19,1,75,1)Line(19,8,75,8)Line(19,15,75,15)Line(19,22,75,22)Line(19,29,75,29)Line(19,36,75,36)Line(19,43,75,43)Line(19,50,75,50)Line(19,57,75,57)For(A,0,31)If ({A*4+L1}=!0)A>15üBPt-On({A*4+L1+1?r1},{r1+1},B*6+{r1+2}*8+Pic1PCS)EndEndDispGraphReturnEndEndIf (0)Lbl ARepeat (getKey(55))sub(M)If ((getKey(54)) and (((Á)-14)={Lƒ+18}) and ((Y)<1))Á-14üÁ1üYEndIf ((getKey(54)) and ((Á-7)={Lƒ+18}) and ((Z-1)={Lƒ+17}))Á-7üÁ1üYEndIf ((getKey(54)) and ((Á-7)={Lƒ+18}) and ((Z-7)=({Lƒ+17}+1)))For(X,1,16)If ((({Lƒ+17}+1)=({L+X})) and (({Lƒ+18})=({L‚+X})))0ü{L+X}0ü{L‚+X}Á-7üÁZ-7üZ1üYEndEndEndIf ((getKey(54)) and ((Á-7)={Lƒ+18}) and ((Z+7)=({Lƒ+17}+1)))For(X,1,16)If ((({Lƒ+17}+1)=({L+X})) and (({Lƒ+18})=({L‚+X})))0ü{L+X}0ü{L‚+X}Á-7üÁZ+7üZ1üYEndEndEndsub(O)EndReturnEndIf (0)Lbl BRepeat (getKey(55))sub(M)If ((getKey(54)) and (((Á)+14)={Lƒ+18}) and ((Y)<1))Á+14üÁ1üYEndIf ((getKey(54)) and ((Á+7)={Lƒ+18}) and ((Z-1)={Lƒ+17}))Á+7üÁ1üYEndIf ((getKey(54)) and ((Á+7)={Lƒ+18}) and ((Z-7)=({Lƒ+17}+1)))For(X,1,16)If ((({Lƒ+17}+1)=({L„+X})) and (({Lƒ+18})=({L…+X})))0ü{L„+X}0ü{L…+X}Á+7üÁZ-7üZ1üYEndEndEndIf ((getKey(54)) and ((Á+7)={Lƒ+18}) and ((Z+7)=({Lƒ+17}+1)))For(X,1,16)If ((({Lƒ+17}+1)=({L„+X})) and (({Lƒ+18})=({L…+X})))0ü{L„+X}0ü{L…+X}Á+7üÁ0Z+7üZ1üYEndEndEndsub(O)EndReturnEndIf (0)Lbl CRepeat (getKey(55))sub(M)If (getKey(54))For(V,1,50)If (((Z+V)=({Lƒ+17}+1)) and ((Á+V)=({Lƒ+18}))Z+VüZÁ+VüÁEndIf (((Z-V)=({Lƒ+17}+1)) and ((Á+V)={Lƒ+18}))Z-VüZV+ÁüÁEndIf (((Z+V)=({Lƒ+17}+1)) and ((Á-V)={Lƒ+18}))Z+VüZÁ-VüÁEndIf (((Z-V)=({Lƒ+17}+1)) and ((Á-V)={Lƒ+18}))Z-VüZÁ-VüÁEndIf (getKey(54))For(X,1,16)If ((({Lƒ+17}+1)={L+X}) and ({Lƒ+18}={L‚+X}))0ü{L+X}0ü{L‚+X}EndEndEndIf (getKey(54))For(X,1,16)If ((({Lƒ+17}+1)={L„+X}) and ({L…+X}={Lƒ+18}))0ü{L„+X}0ü{L…+X}EndEndEndEndEndsub(O)EndReturnEndIf (0)Lbl DRepeat (getKey(55))sub(M)If (getKey(54))For(V,1,49)If ((Z=({Lƒ+17}+1) and ({Lƒ+18}=(Á+V)))Á+VüÁEndIf ((Z=({Lƒ+17}+1) and ({Lƒ+18}=(Á-V)))Á-VüÁEndIf (((Z+V)=({Lƒ+17}+1) and ({Lƒ+18}=Á))Z+VüZEndIf (((Z-V)=({Lƒ+17}+1) and ({Lƒ+18}=Á))Z-VüZEndEndIf (getKey(54))For(V,1,16)If ((({Lƒ+17}+1)={L+V}) and ({Lƒ+18}={L‚+V}))0ü{L+V}0ü{L‚+V}EndIf ((({Lƒ+17}+1)={L„+V}) and ({Lƒ+18}={L…+V}))0ü{L„+V}0ü{L…+V}EndEndEndEndsub(O)EndReturnEndIf (0)Lbl ERepeat (getKey(55))sub(M)If (getKey(54))If ((({Lƒ+17}+1)=(Z+7)) and ({Lƒ+18}=(Á+14)))Z+7üZÁ+14üÁEndIf ((({Lƒ+17}+1)=(Z-7)) and ({Lƒ+18}=(Á+14)))Z-7üZÁ+14üÁEndIf ((({Lƒ+17}+1)=(Z+7)) and ({Lƒ+18}=(Á-14)))Z+7üZÁ-14üÁEndIf ((({Lƒ+17}+1)=(Z-7)) and ({Lƒ+18}=(Á-14)))Z-7üZÁ-14üÁEndIf ((({Lƒ+17}+1)=(Z+14)) and ({Lƒ+18}=(Á+7)))Z+14üZÁ+7üÁEndIf ((({Lƒ+17}+1)=(Z-14)) and ({Lƒ+18}=(Á+7)))Z-14üZÁ+7üÁEndIf ((({Lƒ+17}+1)=(Z+14)) and ({Lƒ+18}=(Á-7)))Z+14üZÁ-7üÁEndIf ((({Lƒ+17}+1)=(Z-14)) and ({Lƒ+18}=(Á-7)))Z-14üZÁ-7üÁEndFor(V,1,16)If ((({Lƒ+17}+1)={L+V}) and ({Lƒ+18}={L‚+V}))0ü{L+V}0ü{L‚+V}EndIf ((({Lƒ+17}+1)={L„+V}) and ({Lƒ+18}={L…+V}))0ü{L„+V}0ü{L…+V}EndEndEndsub(O)EndReturnEndIf (0)Lbl FRepeat (getKey(55))sub(M)If (getKey(54))For(X,1,49)If ((({Lƒ+17}+1)=(Z+X)) and ({Lƒ+18}=(Á+X)))Z+XüZÁ+XüÁEndIf ((({Lƒ+17}+1)=(Z-X)) and ({Lƒ+18}=(Á+X)))Z-XüZÁ+XüÁEndIf ((({Lƒ+17}+1)=(Z+X)) and ({Lƒ+18}=(Á-X)))Z+XüZÁ-XüÁEndIf ((({Lƒ+17}+1)=(Z-X)) and ({Lƒ+18}=(Á-X)))Z-XüZÁ-XüÁEndIf ((({Lƒ+17}+1)=(Z+X)) and ({Lƒ+18}=(Á)))Z+XüZEndIf ((({Lƒ+17}+1)=(Z-X)) and ({Lƒ+18}=(Á)))Z-XüZEndIf ((({Lƒ+17}+1)=(Z)) and ({Lƒ+18}=(Á+X)))Á+XüÁEndIf ((({Lƒ+17}+1)=(Z)) and ({Lƒ+18}=(Á-X)))Á-XüÁEndEndFor(V,1,16)If ((({Lƒ+17}+1)={L+V}) and ({Lƒ+18}={L‚+V}))0ü{L+V}0ü{L‚+V}EndIf ((({Lƒ+17}+1)={L„+V}) and ({Lƒ+18}={L…+V}))0ü{L„+V}0ü{L…+V}EndEndEndsub(O)EndReturnEndIf (0)Lbl GRepeat (getKey(55))sub(M)If (getKey(54))If ((({Lƒ+17}+1)=(Z+7)) and ({Lƒ+18}=(Á+7)))Z+7üZÁ+7üÁEndIf ((({Lƒ+17}+1)=(Z-7)) and ({Lƒ+18}=(Á+7)))Z-7üZÁ+7üÁEndIf ((({Lƒ+17}+1)=(Z+7)) and ({Lƒ+18}=(Á-7)))Z+7üZÁ-7üÁEndIf ((({Lƒ+17}+1)=(Z-7)) and ({Lƒ+18}=(Á-7)))Z-7üZÁ-7üÁEndIf ((({Lƒ+17}+1)=(Z+7)) and ({Lƒ+18}=(Á)))Z+7üZEndIf ((({Lƒ+17}+1)=(Z-7)) and ({Lƒ+18}=(Á)))Z-7üZEndIf ((({Lƒ+17}+1)=(Z)) and ({Lƒ+18}=(Á+7)))Á+7üÁEndIf ((({Lƒ+17}+1)=(Z)) and ({Lƒ+18}=(Á-7)))Á-7üÁEndIf ((({Lƒ+17}+1)=(Z+14)) and ({Lƒ+18}=Á) and (Á={L…+8}))Z+14üZ{L„+8}-14ü{L„+8}EndIf ((({Lƒ+17}+1)=(Z+14)) and ({Lƒ+18}=Á) and (Á={L‚+8}))Z+14üZ{L+8}-14ü{L+8}EndIf ((({Lƒ+17}+1)=(Z-14)) and ({Lƒ+18}=Á) and (Á={L‚+1}))Z-14üZ{L+1}+21ü{L+1}EndIf ((({Lƒ+17}+1)=(Z-14)) and ({Lƒ+18}=Á) and (Á={L…+1}))Z-14üZ{L„+1}+21ü{L„+1}EndFor(V,1,16)If ((({Lƒ+17}+1)={L+V}) and ({Lƒ+18}={L‚+V}))0ü{L+V}0ü{L‚+V}EndIf ((({Lƒ+17}+1)={L„+V}) and ({Lƒ+18}={L…+V}))0ü{L„+V}0ü{L…+V}EndEndEndsub(O)EndReturnEndIf (0)Lbl PReturnEnd