- 分享
- 2009-10-31 22:03:30 @
自己写的五子棋程序,思路是给每个格子加分,但是程序AI还是不够高,哪位大牛能帮忙优化一下
program qi5;
uses
crt;
const
min=5;
max=15;
type
node2=record
bj:integer;
xx:integer;
yy:integer;
end;
dt=array[1..min] of node2;
point=^node;
node=record
data:dt;
link:point;
end;
map=array[1..max,1..max]of integer;
procedure insert(var head:point;x:dt);
var
p,n:point;
begin
new(p);
p^.link:=nil;
p^.data:=x;
if head=nil then head:=p
else begin
n:=head;
while n^.linknil do
n:=n^.link;
n^.link:=p;
end;
end;
function cp(r:dt):dt;
var
i,j:integer;t:node2;
begin
for i:=1 to min-1 do
for j:=i+1 to min do
if r[i].bj
0 条评论
目前还没有评论...