ПППЪЪОПЭОЪЪЪЪЪПЪПЪ ннннпппщщМпэМщщщщ щпщпщ нннн33333333333333333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDЧЪПОЧЧЪЪПОНЪннО О чщпМччщщпМНщннМ М ППЪЪЪоЪПЪЪПЪЪЪЪо ОнЪнЪоЪО ЪО ЪО ппщщщмщпщщпщ щщщ м МнщнщмщМ щМ щМ ППЪПЧЪОЧЪПОНЧЪЪОННЪО ЪО ЪЪ НЪ ЪЪ НЧнЪЪнЧЪнппщпчщМчщпМНчщщМННщМ щМ щщ Нщ щщ Нчнщщнчщн┴ >ю?ллэлмлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллэщмлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллщщМнллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллмщщнлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллэщщщмлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллэщмщМлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллщщлщМлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллщмлщМлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллэлэщМлллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллщщМллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллэчщщллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллщМНщллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллчщщщллллллллллллллллллллллллл33СС33DDТТDD33СС33DDТТDD33СС33DDТТDD33СС33DDТТDD33СС33ллллллллллллллллллллллллллллллллллллэМННчнлллллллллллллллллллллллл33СЪ33DDТЪDD33СЪ33DDТЪDD33СЪ33DDТЪDD33СЪ33DDТЪDD33СЪ33ллллллллллллллллллллллллллллллллллллчщщщщнлллллллллллллллллллллллл33ЪО<3DDЪОLD33ЪО<3DDЪОLD33ЪО<3DDЪОLD33ЪО<3DDЪОLD33ЪО<3ллллллллллллллллллллллллллллллллллллМННчщнллллллллллллллллллл▄лллл3СЭО<3DТЭОLD3СЭО<3DТЭОLD3СЭО<3DТЭОLD3СЭО<3DТЭОLD3СЭО<3ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл┬лллл3ЪЪЪн3DЪЪЪнD3ЪЪЪн3DЪЪЪнD3ЪЪЪн3DЪЪЪнD3ЪЪЪн3DЪЪЪнD3ЪЪЪн3ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл▄лллл3Ъ?Ън3DЪOЪнD3Ъ?Ън3DЪOЪнD3Ъ?Ън3DЪOЪнD3Ъ?Ън3DЪOЪнD3Ъ?Ън3ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл▄лллл3С3Ън3DТDЪнD3С3Ън3DТDЪнD3С3Ън3DТDЪнD3С3Ън3DТDЪнD3С3Ън3ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл┬хллл33СЪн3DDТЪнD33СЪн3DDТЪнD33СЪн3DDТЪнD33СЪн3DDТЪнD33СЪн3лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл33ЧЪн3DDЧЪнD33ЧЪн3DDЧЪнD33ЧЪн3DDЧЪнD33ЧЪн3DDЧЪнD33ЧЪн3лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл3СОЧн3DТОЧнD3СОЧн3DТОЧнD3СОЧн3DТОЧнD3СОЧн3DТОЧнD3СОЧн3лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл3ЧЪЪО81 then --resetting color to prevent epilepsy party color=1 end end end --displaying white pieces for loop=1,gen_amount*3,3 do if pieces[loop]==1 then spr(1, pieces[loop+1], pieces[loop+2], 0,1,0,0,2,2) else spr(3, pieces[loop+1], pieces[loop+2], 0,1,0,0,2,2) end end --displaying board coordinates --letters print("A",62+4,122,background*2, true,1,true) print("B",74+4,122,background*2, true,1,true) print("C",86+4,122,background*2, true,1,true) print("D",98+4,122,background*2, true,1,true) print("E",110+4,122,background*2, true,1,true) print("F",122+4,122,background*2, true,1,true) print("G",134+4,122,background*2, true,1,true) print("H",146+4,122,background*2, true,1,true) print("I",158+4,122,background*2, true,1,true) --numbers for loop=1,9 do print(loop,52,3+loop*12,background*2, true,1,true) end --input --start X if input.a1>0 then for loop=1,9 do if loop==input.a1 then print(x_inputs[loop],8,130,background*2, true,1,true) end end end --start Y if input.a2>0 then print(input.a2,14,130,background*2, true,1,true) end --goal X if input.a3>0 then for loop=1,9 do if loop==input.a3 then print(x_inputs[loop],24,130,background*2, true,1,true) end end end --goal Y if input.a4>0 then print(input.a4,30,130,background*2, true,1,true) end --who's turn now if turn%2==0 then spr(34, 0,0, 0,1,0,0,2,2) else spr(32, 0,0, 0,1,0,0,2,2) end for loop=240,60,-1 do if win==1 then print("BLACK WIN!", loop,loop, loop,true,2,false) end if win==2 then print("WHITE WIN!", loop,loop, loop,true,2,false) end end end function controls() --start X position for loop=1,9 do if keyp(loop,60,60) and input.a1==0 then input.a1=loop end end --start Y position for loop=28,36 do if keyp(loop,60,60) and input.a1>0 and input.a2==0 then input.a2=loop-27 end end --goal X position for loop=1,9 do if keyp(loop,60,60) and input.a1>0 and input.a2>0 and input.a3==0 then input.a3=loop end end --goal Y position for loop=28,36 do if keyp(loop,60,60) and input.a1>0 and input.a2>0 and input.a3>0 and input.a4==0 then input.a4=loop-27 end end --deleting turn inputs if key(51) then input.a1=0 input.a2=0 input.a3=0 input.a4=0 end --confirming turn... --fuck this shit if keyp(48,60,60) and input.a4>0 then collisions() capture() end end function collisions() --going through pieces for loop=1,gen_amount*3,3 do --if piece corresponding to turn --order properly if turn%2==pieces[loop]%2 --if start x and y correspond --properly to current piece and (pieces[loop+1]-2)//12-4==input.a1 and pieces[loop+2]//12==input.a2 then --if goal coordinates are valid if math.abs(input.a1-input.a3)==2 and math.abs(input.a2-input.a4)==1 then pieces[loop+1]=(input.a3+4)*12+2 pieces[loop+2]=input.a4*12 turn=turn+1 e5_win() else if math.abs(input.a1-input.a3)==1 and math.abs(input.a2-input.a4)==2 then pieces[loop+1]=(input.a3+4)*12+2 pieces[loop+2]=input.a4*12 turn=turn+1 e5_win() end end end --if target coordinates aren't --the pieces of same color for loop2=1,gen_amount*3,3 do --if collided with piece of same color if pieces[loop]==pieces[loop2] and pieces[loop+1]==pieces[loop2+1] and pieces[loop+2]==pieces[loop2+2] and loop~=loop2 then pieces[loop+1]=(input.a1+4)*12+2 pieces[loop+2]=input.a2*12 turn=turn+1 end end end end function capture() for loop=1,gen_amount*3,3 do for loop2=1,gen_amount*3,3 do --if collided with enemy if pieces[loop]~=pieces[loop2] and pieces[loop+1]==pieces[loop2+1] and pieces[loop+2]==pieces[loop2+2] then if pieces[loop2]%2==turn%2 then if pieces[loop2]%2==0 then white_count=white_count-1 else black_count=black_count-1 end table.remove(pieces,loop2+2) table.remove(pieces,loop2+1) table.remove(pieces,loop2) else if pieces[loop]%2==0 then white_count=white_count-1 else black_count=black_count-1 end table.remove(pieces,loop+2) table.remove(pieces,loop+1) table.remove(pieces,loop) end gen_amount=gen_amount-1 capture_win() break end end end end function e5_win() if input.a1==5 and input.a2==5 then if turn%2==0 then --black win win=1 else win=2 end end end function capture_win() if black_count==0 then win=2 end if white_count==0 then win=1 end end function BOOT() background=math.random(1,15) end function TIC() timer=timer+1 draw() if win==0 then controls() end end