中國象棋源代碼
中國象棋源代碼
中國象棋的源程序,中文模式下方可使用。
程序代碼:
type
? qp=array[0..9,1..9]of shortint;
? const
? es:array['a'..'i']of byte=(1,2,3,4,5,6,7,8,9);
? se:array[ 1 .. 9 ]of char=('a','b','c','d','e','f','g','h','i');
? ci:array['0'..'9']of byte=(0,1,2,3,4,5,6,7,8,9);
? qz:array[ 1 ..14 ]of string[2]=('車','馬','炮','仕','相','兵','帥','車','馬','包','士','象','卒','將');
? yqp:qp=(( 8, 9,12,11,14,11,12, 9, 8),
??????? ( 0, 0, 0, 0, 0, 0, 0, 0, 0),
??????? ( 0,10, 0, 0, 0, 0, 0,10, 0),
??????? (13, 0,13, 0,13, 0,13, 0,13),
??????? ( 0, 0, 0, 0, 0, 0, 0, 0, 0),
??????? ( 0, 0, 0, 0, 0, 0, 0, 0, 0),
??????? ( 6, 0, 6, 0, 6, 0, 6, 0, 6),
??????? ( 0, 3, 0, 0, 0, 0, 0, 3, 0),
??????? ( 0, 0, 0, 0, 0, 0, 0, 0, 0),
??????? ( 1, 2, 5, 4, 7, 4, 5, 2, 1));
var
? t,sx,sy,ex,ey,bushu:integer;
? qipan:qp;
procedure initqp(var a:qp);
var i,j:integer;
begin
? fillchar(a,sizeof(a),0);
? for i:=1 to 9 do
? for j:=0 to 9 do
? a[j,i]:=yqp[j,i];
end;
procedure print(q:qp);
var i,j:integer;
? b:array[1..10,1..9]of string[2];
begin
? writeln;
? writeln('中國象棋[By angwuy]');
? writeln('紅:帥仕相車馬炮兵');
? writeln('黑:將士象車馬包卒');
? writeln;
非常好我支持^.^
(7) 100%
不好我反對
(0) 0%