yes, i didn't impelment double jumping
i figured the ai was kinda easy, but the system i use for it can be changed very easily to make it harder. i'll post the source so anyone who wants to look at it can.
sync on
sync rate 0
set display mode 640,480,32
show window
set window title "Square Checkers"
rem variables
#constant playercolor rgb(236,80,13)
#constant computercolor rgb(83,83,83)
#constant backgroundcolor rgb(125,116,106)
#constant boardmaincolor rgb(5,5,5)
#constant boardsecondarycolor rgb(211,57,5)
#constant selectedcolor rgb(213,220,69)
#constant buttoncolor rgb(103,99,137)
#constant black rgb(0,0,0)
#constant boardxposition 90
#constant boardyposition 25
#constant squaresize 55
turn=1
type squaretype
xmin as float
xmax as float
ymin as float
ymax as float
occupation as integer
endtype
dim sq(8,8) as squaretype
rem store the square positions and set peice initial position
for x=0 to 7 : for y=0 to 7 : if even(y)=even(x)
sq(x,y).xmin=boardxposition+(x)*squaresize
sq(x,y).xmax=boardxposition+(x+1)*squaresize
sq(x,y).ymin=boardyposition+(y)*squaresize
sq(x,y).ymax=boardyposition+(y+1)*squaresize
if y<3 then sq(x,y).occupation=2
if y>4 then sq(x,y).occupation=1
endif : next y : next x
rem for the player to select and move peices
type peiceselector
x as integer
y as integer
true as boolean
endtype
selected as peiceselector
rem for ai of the computer player
type jumptype
fx as integer
fy as integer
tx as integer
ty as integer
danger as integer
endtype
type movetype
fx as integer
fy as integer
tx as integer
ty as integer
danger as integer
endtype
dim jump() as jumptype
dim move() as movetype
rem --------------------------------
do
if turn=2 then gosub _move_computer
if turn=1 then gosub _move_player
gosub _draw_game
ink rgb(255,255,255),black
if loses=-1 then text 280,5,"You won!"
if loses=1 then text 280,5,"You lost!"
text 10,5,"Square Checkers"
text 560,20,"Forfeit"
sync
loop
rem ---------------------------------
rem moves the player if it is his turn
_move_player:
if mouseclick()=1
xpos=mousex()
ypos=mousey()
rem check all squares
for x=0 to 7 : for y=0 to 7 : if even(y)=even(x)
rem check to see if square is clicked upon
if xpos>sq(x,y).xmin and xpos<sq(x,y).xmax and ypos>sq(x,y).ymin and ypos<sq(x,y).ymax
rem if player piece selected
if sq(x,y).occupation=1 or sq(x,y).occupation=3
selected.true=1
selected.x=x
selected.y=y
endif
rem if computer piece selected
if sq(x,y).occupation=2 or sq(x,y).occupation=4
selected.true=0
selected.x=0
selected.y=0
endif
rem if blank square selected
if sq(x,y).occupation=0
if selected.true
rem if moving 1 square
if y+1=selected.y
if x+1=selected.x or x-1=selected.x
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
turn=2
endif
endif
rem if king moving 1 square
if y-1=selected.y and sq(selected.x,selected.y).occupation=3
if x+1=selected.x or x-1=selected.x
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
turn=2
endif
endif
rem if jumping
if y+2=selected.y
if x+2=selected.x and sq(x+1,y+1).occupation=2 or x+2=selected.x and sq(x+1,y+1).occupation=4
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
sq(x+1,y+1).occupation=0
turn=2
endif
if x-2=selected.x and sq(x-1,y+1).occupation=2 or x-2=selected.x and sq(x-1,y+1).occupation=4
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
sq(x-1,y+1).occupation=0
turn=2
endif
endif
rem if king jumping
if y-2=selected.y and sq(selected.x,selected.y).occupation=3
if x+2=selected.x and sq(x+1,y-1).occupation=2 or x+2=selected.x and sq(x+1,y-1).occupation=4
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
sq(x+1,y-1).occupation=0
turn=2
endif
if x-2=selected.x and sq(x-1,y-1).occupation=2 or x-2=selected.x and sq(x-1,y-1).occupation=4
sq(x,y).occupation=sq(selected.x,selected.y).occupation
sq(selected.x,selected.y).occupation=0
sq(x-1,y-1).occupation=0
turn=2
endif
endif
endif
selected.true=0
selected.x=0
selected.y=0
endif
endif
endif : next y : next x
rem king any pieces
for x=0 to 6 step 2
if sq(x,0).occupation=1 then sq(x,0).occupation=3
next x
rem if player gives up
if xpos>550 and xpos<630 and ypos>10 and ypos<50 then loses=1
endif
return
rem move the computer if it is his turn
_move_computer:
wait 1000
rem check all pieces for available moves
for x=0 to 7 : for y=0 to 7 : if even(y)=even(x)
rem for general moves
if sq(x,y).occupation=2 or sq(x,y).occupation=4
rem check a move to the right
if valid(x+1) and valid(y+1)
if sq(x+1,y+1).occupation=0
array insert at bottom move(0)
num=array count(move(0))
move(num).fx=x
move(num).fy=y
move(num).tx=x+1
move(num).ty=y+1
if valid(x+2) and valid(y+2)
if sq(x+2,y+2).occupation=1 or sq(x+2,y+2).occupation=3 then inc move(num).danger,2
if sq(x,y+2).occupation=1 and sq(x+2,y).occupation=0 then inc move(num).danger,2
if sq(x,y+2).occupation=3 and sq(x+2,y).occupation=0 then inc move(num).danger,2
if sq(x+2,y).occupation=3 and sq(x,y+2).occupation=0 then inc move(num).danger,2
endif
if sq(x,y).occupation=2
if valid(y+2)=0 then inc move(num).danger,-1
if y=0 then inc move(num).danger,1
else
inc move(num).danger,1
endif
endif
endif
rem check a move to the left
if valid(x-1) and valid(y+1)
if sq(x-1,y+1).occupation=0
array insert at bottom move(0)
num=array count(move(0))
move(num).fx=x
move(num).fy=y
move(num).tx=x-1
move(num).ty=y+1
if valid(x-2) and valid(y+2)
if sq(x-2,y+2).occupation=1 or sq(x-2,y+2).occupation=3 then inc move(num).danger,2
if sq(x,y+2).occupation=1 and sq(x-2,y).occupation=0 then inc move(num).danger,2
if sq(x,y+2).occupation=3 and sq(x-2,y).occupation=0 then inc move(num).danger,2
if sq(x-2,y).occupation=3 and sq(x,y+2).occupation=0 then inc move(num).danger,2
endif
if sq(x,y).occupation=2
if valid(y+2)=0 then inc move(num).danger,-1
if y=0 then inc move(num).danger,1
else
inc move(num).danger,1
endif
endif
endif
rem check for a jump to the right
if valid(x+2) and valid(y+2)
if sq(x+2,y+2).occupation=0 and sq(x+1,y+1).occupation=1 or sq(x+2,y+2).occupation=0 and sq(x+1,y+1).occupation=3
array insert at bottom jump(0)
num=array count(jump(0))
jump(num).fx=x
jump(num).fy=y
jump(num).tx=x+2
jump(num).ty=y+2
if valid(x+3) and valid(y+3)
if sq(x+3,y+3).occupation=1 or sq(x+3,y+3).occupation=3 then inc jump(num).danger,2
if sq(x+1,y+3).occupation=1 and sq(x+3,y+1).occupation=0 then inc jump(num).danger,2
if sq(x+1,y+3).occupation=3 and sq(x+3,y+1).occupation=0 then inc jump(num).danger,2
if sq(x+3,y+1).occupation=3 and sq(x+1,y+3).occupation=0 then inc jump(num).danger,2
endif
if sq(x,y).occupation=2
if valid(y+3)=0 then inc jump(num).danger,-1
if y=0 then inc jump(num).danger,1
if sq(x+1,y+1).occupation=3 then inc jump(num).danger,-3
endif
endif
endif
rem check for a jump to the left
if valid(x-2) and valid(y+2)
if sq(x-2,y+2).occupation=0 and sq(x-1,y+1).occupation=1 or sq(x-2,y+2).occupation=0 and sq(x-1,y+1).occupation=3
array insert at bottom jump(0)
num=array count(jump(0))
jump(num).fx=x
jump(num).fy=y
jump(num).tx=x-2
jump(num).ty=y+2
if valid(x-3) and valid(y+3)
if sq(x-3,y+3).occupation=1 or sq(x-3,y+3).occupation=3 then inc jump(num).danger,2
if sq(x-1,y+3).occupation=1 and sq(x-3,y+1).occupation=0 then inc jump(num).danger,2
if sq(x-1,y+3).occupation=3 and sq(x-3,y+1).occupation=0 then inc jump(num).danger,2
if sq(x-3,y+1).occupation=3 and sq(x-1,y+3).occupation=0 then inc jump(num).danger,2
endif
if sq(x,y).occupation=2
if valid(y+3)=0 then inc jump(num).danger,-1
if y=0 then inc jump(num).danger,1
if sq(x-1,y+1).occupation=3 then inc jump(num).danger,-3
endif
endif
endif
endif
rem for special king moves
if sq(x,y).occupation=4
rem for a king to move up and right
if valid(x+1) and valid(y-1)
if sq(x+1,y-1).occupation=0
array insert at bottom move(0)
num=array count(move(0))
move(num).fx=x
move(num).fy=y
move(num).tx=x+1
move(num).ty=y-1
if valid(x+2) and valid(y-2)
if sq(x+2,y-2).occupation=1 or sq(x+2,y-2).occupation=3 then inc move(num).danger,2
if sq(x,y-2).occupation=1 and sq(x+2,y).occupation=0 then inc move(num).danger,2
if sq(x,y-2).occupation=3 and sq(x+2,y).occupation=0 then inc move(num).danger,2
if sq(x+2,y).occupation=3 and sq(x,y-2).occupation=0 then inc move(num).danger,2
endif
endif
endif
rem for a king to move up and left
if valid(x-1) and valid(y-1)
if sq(x-1,y-1).occupation=0
array insert at bottom move(0)
num=array count(move(0))
move(num).fx=x
move(num).fy=y
move(num).tx=x-1
move(num).ty=y-1
if valid(x-2) and valid(y-2)
if sq(x-2,y-2).occupation=1 or sq(x-2,y-2).occupation=3 then inc move(num).danger,2
if sq(x,y-2).occupation=1 and sq(x-2,y).occupation=0 then inc move(num).danger,2
if sq(x,y-2).occupation=3 and sq(x-2,y).occupation=0 then inc move(num).danger,2
if sq(x-2,y).occupation=3 and sq(x,y-2).occupation=0 then inc move(num).danger,2
endif
endif
endif
rem for a king to jump up and to the right
if valid(x+2) and valid(y-2)
if sq(x+2,y-2).occupation=0 and sq(x+1,y-1).occupation=1 or sq(x+2,y-2).occupation=0 and sq(x+1,y-1).occupation=3
array insert at bottom jump(0)
num=array count(jump(0))
jump(num).fx=x
jump(num).fy=y
jump(num).tx=x+2
jump(num).ty=y-2
if valid(x+3) and valid(y-3)
if sq(x+3,y-3).occupation=1 or sq(x+3,y-3).occupation=3 then inc jump(num).danger,2
if sq(x+1,y-3).occupation=1 and sq(x+3,y-1).occupation=0 then inc jump(num).danger,2
if sq(x+1,y-3).occupation=3 and sq(x+3,y-1).occupation=0 then inc jump(num).danger,2
if sq(x+3,y-1).occupation=3 and sq(x+1,y-3).occupation=0 then inc jump(num).danger,2
endif
endif
endif
rem for a king to jump up and to the left
if valid(x-2) and valid(y-2)
if sq(x-2,y-2).occupation=0 and sq(x-1,y-1).occupation=1 or sq(x-2,y-2).occupation=0 and sq(x-1,y-1).occupation=3
array insert at bottom jump(0)
num=array count(jump(0))
jump(num).fx=x
jump(num).fy=y
jump(num).tx=x-2
jump(num).ty=y-2
if valid(x-3) and valid(y-3)
if sq(x-3,y-3).occupation=1 or sq(x-3,y-3).occupation=3 then inc jump(num).danger,2
if sq(x-1,y-3).occupation=1 and sq(x-3,y-1).occupation=0 then inc jump(num).danger,2
if sq(x-1,y-3).occupation=3 and sq(x-3,y-1).occupation=0 then inc jump(num).danger,2
if sq(x-3,y-1).occupation=3 and sq(x-1,y-3).occupation=0 then inc jump(num).danger,2
endif
endif
endif
endif
endif : next y : next x
rem find number of moves and jumps available
jumps=array count(jump(0))
moves=array count(move(0))
rem check if jumps are available
if jumps>-1
rem take the best jump
bestjump=0
for x=0 to jumps
if jump(x).danger<jump(bestjump).danger then bestjump=x
next x
sq(jump(bestjump).tx,jump(bestjump).ty).occupation=sq(jump(bestjump).fx,jump(bestjump).fy).occupation
sq(jump(bestjump).fx,jump(bestjump).fy).occupation=0
rem get rid of the jumped piece
if jump(bestjump).ty-jump(bestlump).fy>0
if jump(bestjump).fx-jump(bestjump).tx>0
sq(jump(bestjump).fx-1,jump(bestjump).fy+1).occupation=0
else
sq(jump(bestjump).fx+1,jump(bestjump).fy+1).occupation=0
endif
else
if jump(bestjump).fx-jump(bestjump).tx>0
sq(jump(bestjump).fx-1,jump(bestjump).fy-1).occupation=0
else
sq(jump(bestjump).fx+1,jump(bestjump).fy-1).occupation=0
endif
endif
else
rem if only moves are available
if moves>-1
rem take the best move
bestmove=0
for x=0 to moves
if move(x).danger<move(bestmove).danger then bestmove=x
next x
sq(move(bestmove).tx,move(bestmove).ty).occupation=sq(move(bestmove).fx,move(bestmove).fy).occupation
sq(move(bestmove).fx,move(bestmove).fy).occupation=0
else
loses=-1
endif
endif
rem king any pieces
for x=1 to 7 step 2
if sq(x,7).occupation=2 then sq(x,7).occupation=4
next x
rem reset the arrays
empty array move(0)
empty array jump(0)
rem change turns
turn=1
return
rem draws the board and peices
_draw_game:
rem draw the background board color
cls backgroundcolor
ink boardsecondarycolor,black
box boardxposition,boardyposition,boardxposition+squaresize*8,boardyposition+squaresize*8
rem draw the squares and peices
for x=0 to 7 : for y=0 to 7 : if even(y)=even(x)
rem draw the squares
ink boardmaincolor,black
box sq(x,y).xmin,sq(x,y).ymin,sq(x,y).xmax,sq(x,y).ymax
rem draw the peices
select sq(x,y).occupation
case 1
ink playercolor,black
box sq(x,y).xmin+squaresize/4,sq(x,y).ymin+squaresize/4,sq(x,y).xmax-squaresize/4,sq(x,y).ymax-squaresize/4
endcase
case 2
ink computercolor,black
box sq(x,y).xmin+squaresize/4,sq(x,y).ymin+squaresize/4,sq(x,y).xmax-squaresize/4,sq(x,y).ymax-squaresize/4
endcase
case 3
ink playercolor,black
box sq(x,y).xmin+squaresize/4,sq(x,y).ymin+squaresize/4,sq(x,y).xmax-squaresize/4,sq(x,y).ymax-squaresize/4
ink boardmaincolor,black
box sq(x,y).xmin+squaresize/3,sq(x,y).ymin+squaresize/3,sq(x,y).xmax-squaresize/3,sq(x,y).ymax-squaresize/3
endcase
case 4
ink computercolor,black
box sq(x,y).xmin+squaresize/4,sq(x,y).ymin+squaresize/4,sq(x,y).xmax-squaresize/4,sq(x,y).ymax-squaresize/4
ink boardmaincolor,black
box sq(x,y).xmin+squaresize/3,sq(x,y).ymin+squaresize/3,sq(x,y).xmax-squaresize/3,sq(x,y).ymax-squaresize/3
endcase
endselect
endif : next y : next x
rem draws a dot on the selected peice
if selected.true
ink selectedcolor,black
dot sq(selected.x,selected.y).xmin+squaresize/2,sq(selected.x,selected.y).ymin+squaresize/2
endif
rem draws the surrender button
ink buttoncolor,black
box 550,10,630,50
return
function even(number)
if number*0.5=int(number*0.5) then result=1
endfunction result
function valid(number)
if number<8 and number>-1 then result=1
endfunction result
it needs no media, so just copy, paste, and compile it.
"Genius is 1% inspiration and 99% perspiration"