主题:井字游戏
'JING game
'2007.1.2
const xq="☆"
const oq="○"
const bq="■"
dim qp(9)
dim i
dim ib
dim cq
dim cT
dim cl
dim back
for i=1 to 9
qp(i)=bq
next
cl=chr(13) & chr(10)
cT=flase
do
cT=not cT
if cT then
cq=oq
else
cq=xq
end if
ib=input
if len(ib)=0 then
exit do
end if
select case ucase(ib)
case "R"
for i=1 to 9
qp(i)=bq
next
cT=false
case "Q"
exit do
case "B"
qp(back)=bq
case "A1"
downq(1)
case "A2"
downq(2)
case "A3"
downq(3)
case "B1"
downq(4)
case "B2"
downq(5)
case "B3"
downq(6)
case "C1"
downq(7)
case "C2"
downq(8)
case "C3"
downq(9)
case else
cT=not CT
end select
loop
function input
dim ib
dim s
s=" 1 2 3" & cl
s=s & "A " & qp(1) & qp(2) & qp(3) & cl
s=s & "B " & qp(4) & qp(5) & qp(6) & cl
s=s & "C " & qp(7) & qp(8) & qp(9)
ib=inputbox(s,"JING")
input = ib
end function
sub downq(I)
if qp(I)=bq then
back=I
qp(I)=cq
else
cT=not cT
end if
end sub
'2007.1.2
const xq="☆"
const oq="○"
const bq="■"
dim qp(9)
dim i
dim ib
dim cq
dim cT
dim cl
dim back
for i=1 to 9
qp(i)=bq
next
cl=chr(13) & chr(10)
cT=flase
do
cT=not cT
if cT then
cq=oq
else
cq=xq
end if
ib=input
if len(ib)=0 then
exit do
end if
select case ucase(ib)
case "R"
for i=1 to 9
qp(i)=bq
next
cT=false
case "Q"
exit do
case "B"
qp(back)=bq
case "A1"
downq(1)
case "A2"
downq(2)
case "A3"
downq(3)
case "B1"
downq(4)
case "B2"
downq(5)
case "B3"
downq(6)
case "C1"
downq(7)
case "C2"
downq(8)
case "C3"
downq(9)
case else
cT=not CT
end select
loop
function input
dim ib
dim s
s=" 1 2 3" & cl
s=s & "A " & qp(1) & qp(2) & qp(3) & cl
s=s & "B " & qp(4) & qp(5) & qp(6) & cl
s=s & "C " & qp(7) & qp(8) & qp(9)
ib=inputbox(s,"JING")
input = ib
end function
sub downq(I)
if qp(I)=bq then
back=I
qp(I)=cq
else
cT=not cT
end if
end sub