以前在九中学习pascal语言写的小程序(九中不知道还有没有计算机编程学习课程了!)
program amber;
uses graph,mouse,winmouse,crt;
var a1,a2,a3,a4,a5,a6:longint;
i,i1,i2,i3,i4,i5,i6:longint;
b1,b2,b3,b4,b5,b6,b7,b8:byte;//color or back
c1,c2,c3,c4,c5,c6:byte;//weizhi canshu
d1,d2,d3,d4,d5,d6:char;//jianruzifu
e1,e2,e3,e4,e5,e6:boolean;//panding
t1,t2,t3,t4,t5,t6:longint;//shijain canshu
f1,f2,f3,f4,f5,f6:longint;//xiao canshu
procedure aa;
begin
textcolor(b6);
gotoxy(1,1); write(' ');
gotoxy(78,1); write(' ');
textcolor(b3);
gotoxy(1,1); write(a1);
gotoxy(78,1); write(a2);
textcolor(b1);
end;
procedure dd;
begin
textcolor(b6);
gotoxy(1,2); write(' ');
gotoxy(78,2); write(' ');
textcolor(14);
gotoxy(1,2); write(t1);
gotoxy(78,2); write(t2);
textcolor(b1);
end;
procedure hello;
begin
textcolor(b2);
gotoxy(32,1); write('英雄联盟之火柴人');
textcolor(b1);
end;
function gg:longint;
begin
end;
procedure bb;
begin
textbackground(b1);
gotoxy(1,4); write(' ');
gotoxy(55,4); write(' ');
textbackground(b6);
end;
procedure cc;
begin
textbackground(b3);
gotoxy(40,3); write(' ');
gotoxy(38,4); write(' ');
gotoxy(40,5); write(' ');
textbackground(b4);
gotoxy(40,4); write(' ');
textbackground(b6);
end;
procedure aaa;//renwumoxing
begin
gotoxy(c1+4,c4); write('○');
textbackground(b2);
gotoxy(c1,c4+1); write(' ');
textbackground(b4);
gotoxy(c1+2,c4+2); write(' ');
gotoxy(c1+6,c4+2); write(' ');
gotoxy(c1+2,c4+3); write(' ');
gotoxy(c1+6,c4+3); write(' ');
textbackground(b6);
end;
procedure bbb;//renwumoxing
begin
gotoxy(c2+4,c5); write('○');
textbackground(b7);
gotoxy(c2,c5+1); write(' ');
textbackground(b8);
gotoxy(c2+2,c5+2); write(' ');
gotoxy(c2+6,c5+2); write(' ');
gotoxy(c2+2,c5+3); write(' ');
gotoxy(c2+6,c5+3); write(' ');
textbackground(b6);
end;
procedure aaaa;//wei chuli
begin
gotoxy(c1+4,c4); write(' ');
gotoxy(c1,c4+1); write(' ');
gotoxy(c1+2,c4+2); write(' ');
gotoxy(c1+6,c4+2); write(' ');
gotoxy(c1+2,c4+3); write(' ');
gotoxy(c1+6,c4+3); write(' ');
end;
procedure bbbb;//wei chuli
begin
gotoxy(c2+4,c5); write(' ');
gotoxy(c2,c5+1); write(' ');
gotoxy(c2+2,c5+2); write(' ');
gotoxy(c2+6,c5+2); write(' ');
gotoxy(c2+2,c5+3); write(' ');
gotoxy(c2+6,c5+3); write(' ');
end;
procedure z1; //zhandou pinggu
begin
if (d1='j') then
begin
if (c4+1=c5) then //dazhu tou
begin
if (c1-c2<-5) and (c1-c2>-10) then begin
a2:=a2-3; t1:=t1+2; end;
if (c1-c2>4) and(c1-c2<9) then begin
a2:=a2-3; t1:=t1+2; end;
end;
if (c4+1=c5+2) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a2:=a2-2; t1:=t1+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a2:=a2-2; t1:=t1+1; end;
end;
if (c4+1=c5+3) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a2:=a2-1; t1:=t1+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a2:=a2-1; t1:=t1+1; end;
end;
end;
end;
procedure fs1;
begin
sound(1235);
delay(500);
nosound;
end;
procedure fs2;
begin
sound(2581);
delay(500);
nosound;
end;
procedure z2; //zhandou pinggu
begin
if (d1='2') then
begin
if (c5+1=c4) then //dazhu tou
begin
if (c1-c2<-5) and (c1-c2>-10) then begin
a1:=a1-3; t2:=t2+2; end;
if (c1-c2>4) and(c1-c2<9) then begin
a1:=a1-3; t2:=t2+2; end;
end;
if (c5+1=c4+2) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a1:=a1-2; t2:=t2+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a1:=a1-2; t2:=t2+1; end;
end;
if (c5+1=c4+3) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a1:=a1-1; t2:=t2+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a1:=a1-1; t2:=t2+1; end;
end;
end;
end;
procedure jieshu;
begin
textcolor(b4);
if a1<0 then begin gotoxy(40,15); write('P2 WIN!!!'); end;
if a2<0 then begin gotoxy(40,15); write('P1 WIN!!!'); end;
delay(2000);
e1:=true;
exit;
end;
program amber;
uses graph,mouse,winmouse,crt;
var a1,a2,a3,a4,a5,a6:longint;
i,i1,i2,i3,i4,i5,i6:longint;
b1,b2,b3,b4,b5,b6,b7,b8:byte;//color or back
c1,c2,c3,c4,c5,c6:byte;//weizhi canshu
d1,d2,d3,d4,d5,d6:char;//jianruzifu
e1,e2,e3,e4,e5,e6:boolean;//panding
t1,t2,t3,t4,t5,t6:longint;//shijain canshu
f1,f2,f3,f4,f5,f6:longint;//xiao canshu
procedure aa;
begin
textcolor(b6);
gotoxy(1,1); write(' ');
gotoxy(78,1); write(' ');
textcolor(b3);
gotoxy(1,1); write(a1);
gotoxy(78,1); write(a2);
textcolor(b1);
end;
procedure dd;
begin
textcolor(b6);
gotoxy(1,2); write(' ');
gotoxy(78,2); write(' ');
textcolor(14);
gotoxy(1,2); write(t1);
gotoxy(78,2); write(t2);
textcolor(b1);
end;
procedure hello;
begin
textcolor(b2);
gotoxy(32,1); write('英雄联盟之火柴人');
textcolor(b1);
end;
function gg:longint;
begin
end;
procedure bb;
begin
textbackground(b1);
gotoxy(1,4); write(' ');
gotoxy(55,4); write(' ');
textbackground(b6);
end;
procedure cc;
begin
textbackground(b3);
gotoxy(40,3); write(' ');
gotoxy(38,4); write(' ');
gotoxy(40,5); write(' ');
textbackground(b4);
gotoxy(40,4); write(' ');
textbackground(b6);
end;
procedure aaa;//renwumoxing
begin
gotoxy(c1+4,c4); write('○');
textbackground(b2);
gotoxy(c1,c4+1); write(' ');
textbackground(b4);
gotoxy(c1+2,c4+2); write(' ');
gotoxy(c1+6,c4+2); write(' ');
gotoxy(c1+2,c4+3); write(' ');
gotoxy(c1+6,c4+3); write(' ');
textbackground(b6);
end;
procedure bbb;//renwumoxing
begin
gotoxy(c2+4,c5); write('○');
textbackground(b7);
gotoxy(c2,c5+1); write(' ');
textbackground(b8);
gotoxy(c2+2,c5+2); write(' ');
gotoxy(c2+6,c5+2); write(' ');
gotoxy(c2+2,c5+3); write(' ');
gotoxy(c2+6,c5+3); write(' ');
textbackground(b6);
end;
procedure aaaa;//wei chuli
begin
gotoxy(c1+4,c4); write(' ');
gotoxy(c1,c4+1); write(' ');
gotoxy(c1+2,c4+2); write(' ');
gotoxy(c1+6,c4+2); write(' ');
gotoxy(c1+2,c4+3); write(' ');
gotoxy(c1+6,c4+3); write(' ');
end;
procedure bbbb;//wei chuli
begin
gotoxy(c2+4,c5); write(' ');
gotoxy(c2,c5+1); write(' ');
gotoxy(c2+2,c5+2); write(' ');
gotoxy(c2+6,c5+2); write(' ');
gotoxy(c2+2,c5+3); write(' ');
gotoxy(c2+6,c5+3); write(' ');
end;
procedure z1; //zhandou pinggu
begin
if (d1='j') then
begin
if (c4+1=c5) then //dazhu tou
begin
if (c1-c2<-5) and (c1-c2>-10) then begin
a2:=a2-3; t1:=t1+2; end;
if (c1-c2>4) and(c1-c2<9) then begin
a2:=a2-3; t1:=t1+2; end;
end;
if (c4+1=c5+2) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a2:=a2-2; t1:=t1+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a2:=a2-2; t1:=t1+1; end;
end;
if (c4+1=c5+3) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a2:=a2-1; t1:=t1+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a2:=a2-1; t1:=t1+1; end;
end;
end;
end;
procedure fs1;
begin
sound(1235);
delay(500);
nosound;
end;
procedure fs2;
begin
sound(2581);
delay(500);
nosound;
end;
procedure z2; //zhandou pinggu
begin
if (d1='2') then
begin
if (c5+1=c4) then //dazhu tou
begin
if (c1-c2<-5) and (c1-c2>-10) then begin
a1:=a1-3; t2:=t2+2; end;
if (c1-c2>4) and(c1-c2<9) then begin
a1:=a1-3; t2:=t2+2; end;
end;
if (c5+1=c4+2) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a1:=a1-2; t2:=t2+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a1:=a1-2; t2:=t2+1; end;
end;
if (c5+1=c4+3) then //dazhu tui 1
begin
if (c1-c2<-7) and (c1-c2>-12) then begin
a1:=a1-1; t2:=t2+1; end;
if (c1-c2>2) and(c1-c2<7) then begin
a1:=a1-1; t2:=t2+1; end;
end;
end;
end;
procedure jieshu;
begin
textcolor(b4);
if a1<0 then begin gotoxy(40,15); write('P2 WIN!!!'); end;
if a2<0 then begin gotoxy(40,15); write('P1 WIN!!!'); end;
delay(2000);
e1:=true;
exit;
end;