咸鱼贴
包九中吧
全部回复
仅看楼主
level 12
Amber琥珀o 楼主
RT
2020年09月22日 10点09分 1
level 12
Amber琥珀o 楼主
以前在九中学习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;
2020年09月22日 10点09分 2
一开始写的时候,还是很简陋的。注释是pinyin!变量函数都是abcd...
2020年09月22日 10点09分
能执行是能执行就是几乎不可维护- -(懒得再去看)
2020年09月22日 10点09分
level 12
Amber琥珀o 楼主
begin
a1:=100; a2:=100;
b1:=15; b2:=9; b3:=4; b4:=5; b5:=6; b6:=0; b7:=7; b8:=2;
c1:=1; c4:=20; //gamer 1
c2:=70; c5:=20; //gamer 2
t1:=0; t2:=0;
f1:=20; f2:=10; f3:=50; f4:=100;
e1:=false;
clrscr;
window(1,1,80,25);
textcolor(b1);
aa; hello; bb; cc;
repeat
aa;dd;
d1:=readkey;
aaaa; bbbb;
if (d1=#61) then fs1;
if (d2=#62) then fs2;
if (d1='s')and(c4<22) then c4:=c4+1;//down
if (d1='a')and(c1>1) then c1:=c1-1;//left
if (d1='d')and(c1<71) then c1:=c1+1;//right
if (d1='w')and(c4>8) then c4:=c4-1;//up
if (d1=#72)and(c5>8) then c5:=c5-1;//up
if (d1=#80)and(c5<22) then c5:=c5+1;//down
if (d1=#75)and(c2>1) then c2:=c2-1;//left
if (d1=#77)and(c2<71) then c2:=c2+1;//right
aaa; bbb;
if (d1='i')and(t1>15) then
begin
if (c1<c2) then
begin
textbackground(14); t1:=t1-15;
for i3:=c1+10 to c2 do
begin
gotoxy(i3+1,c4+1); write(' ');
end;
textbackground(b6);
for i3:=c1+10 to c2+1 do
begin
gotoxy(i3,c4+1); write(' ');
end;
if (c4+1=c5) or (c4+1=c5+1) or (c4+1=c5+2) then
begin bbbb; c2:=c1+8; aaa; a2:=a2-8;
end;
end;
if (c2<c1)and(t1>15) then
begin
textbackground(14); t1:=t1-15;
for i3:=c1-2 downto c2 do
begin
gotoxy(i3+1,c4+1); write(' ');
end;
textbackground(b6);
for i3:=c1-2 downto c2+1 do
begin
gotoxy(i3,c4+1); write(' ');
end;
if (c4+1=c5) or (c4+1=c5+1) or (c4+1=c5+2) then
begin bbbb; c2:=c1-9; aaa; a2:=a2-8;
end;
end;
end;
if (d1='u') then
begin if (c1<c2) then
begin
textbackground(14);
for i3:=c1+10 to c2 do
begin
gotoxy(i3+1,c4+1); write(' ');
end;
textbackground(b6);
for i3:=c1+10 to c2+1 do
begin
gotoxy(i3,c4+1); write(' ');
end;
if (c4+1=c5) or (c4+1=c5+1) or (c4+1=c5+2) then
begin bbbb; c2:=c1+8; aaa; a2:=a2-8;
end;
end;
end;
if (d1='j') then
begin
if (c1<c2) then
begin
textbackground(b2);
gotoxy(c1+10,c4+1); write(' ');
delay(f3);
textbackground(b6);
gotoxy(c1+10,c4+1); write(' ');
end;
if (c1>c2) then
begin
textbackground(b2);
gotoxy(c1-4,c4+1); write(' ');
delay(f3);
textbackground(b6);
gotoxy(c1-4,c4+1); write(' ');
end;
z1;
end;
if (d1='2') then
begin
if (c2<c1) then
begin
textbackground(b1);
gotoxy(c2+10,c5+1); write(' ');
delay(f3);
textbackground(b6);
gotoxy(c2+10,c5+1); write(' ');
end;
if (c2>c1) then
begin
textbackground(b1);
gotoxy(c2-4,c5+1); write(' ');
delay(f3);
textbackground(b6);
gotoxy(c2-4,c5+1); write(' ');
end;
z2;
end;
if (d1='k')and(t1>f1) then
begin
if (c1<c2) then
begin
textbackground(b3);
gotoxy(c1+10,c4); write(' ');
gotoxy(c1+10,c4+1); write(' ');
gotoxy(c1+10,c4+2); write(' ');
for i1:=c1+10 to 80 do
begin
gotoxy(i1+1,c4); write(' ');
gotoxy(i1+1,c4+1); write(' ');
gotoxy(i1+1,c4+2); write(' ');
textbackground(b6);
gotoxy(i1,c4); write(' ');
gotoxy(i1,c4+1); write(' ');
gotoxy(i1,c4+2); write(' ');
textbackground(b3);
end;
if (c4+1=c5) or (c4+1=c5+1) or (c4+1=c5+2) then a2:=a2-10;
textbackground(b6);
end;
if (c1>c2) then
begin
textbackground(b3);
gotoxy(c1-2,c4); write(' ');
gotoxy(c1-2,c4+1); write(' ');
gotoxy(c1-2,c4+2); write(' ');
textbackground(b6);
for i1:=c1-2 downto 2 do
begin
gotoxy(i1-1,c4); write(' ');
gotoxy(i1-1,c4+1); write(' ');
gotoxy(i1-1,c4+2); write(' ');
textbackground(b6);
gotoxy(i1,c4); write(' ');
gotoxy(i1,c4+1); write(' ');
gotoxy(i1,c4+2); write(' ');
textbackground(b3);
end;
if (c4+1=c5) or (c4+1=c5+1) or (c4+1=c5+2) then a2:=a2-10;
textbackground(b6);
end;
t1:=t1-f1;
end;
if (d1='1')and(t2>f1) then
begin
if (c2<c1) then
begin
textbackground(b3);
gotoxy(c2+10,c5); write(' ');
gotoxy(c2+10,c5+1); write(' ');
gotoxy(c2+10,c5+2); write(' ');
for i2:=c2+10 to 80 do
begin
gotoxy(i2+1,c5); write(' ');
gotoxy(i2+1,c5+1); write(' ');
gotoxy(i2+1,c5+2); write(' ');
textbackground(b6);
gotoxy(i2,c5); write(' ');
gotoxy(i2,c5+1); write(' ');
gotoxy(i2,c5+2); write(' ');
textbackground(b3);
end;
if (c5+1=c4) or (c4+1=c4+1) or (c5+1=c4+2) then a1:=a1-10;
textbackground(b6);
end;
if (c2>c1) then
begin
textbackground(b3);
gotoxy(c2-2,c5); write(' ');
gotoxy(c2-2,c5+1); write(' ');
gotoxy(c2-2,c5+2); write(' ');
for i2:=c2-2 downto 2 do
begin
gotoxy(i2-1,c5); write(' ');
gotoxy(i2-1,c5+1); write(' ');
gotoxy(i2-1,c5+2); write(' ');
textbackground(b6);
gotoxy(i2,c5); write(' ');
gotoxy(i2,c5+1); write(' ');
gotoxy(i2,c5+2); write(' ');
textbackground(b3);
end;
if (c5+1=c4) or (c4+1=c4+1) or (c5+1=c4+2) then a1:=a1-10;
textbackground(b6);
end;
t2:=t2-f1;
end;
if a2<0 then jieshu;
if a1<0 then jieshu;
until (d1=#27) or(e1=true);
end.
2020年09月22日 10点09分 3
level 12
Amber琥珀o 楼主
pascal这类语言还是比较严谨的,数据类型也是强类型的,上手可能会慢一些。
2020年09月22日 10点09分 4
level 12
Amber琥珀o 楼主
当然!自学的话还是强烈推荐使用python脚本语言。开始学习可以参考这个网站https://www.runoob.com/python3/python3-tutorial.html,有详细的安装方法教程和简单的教程。
2020年09月22日 10点09分 5
level 12
Amber琥珀o 楼主
安装之后并搭建好环境win+R->cmd->python->print('helloworld')
就可以输出helloworld作为入门第一个程序。
2020年09月22日 10点09分 6
level 12
Amber琥珀o 楼主
如果安装pycharm作为IDE的话建议下载2020.1.1的版本,网上也有破解教程!
2020年09月22日 10点09分 7
level 12
Amber琥珀o 楼主
之后大致会发以下程序和解析
制作一款简易小游戏-点石子
结合CE制作自己单机游戏作弊器
解数独游戏的程序
简单的爬虫
简单的深度学习,识别验证码
简单的解密文程序
基于一定的识别能力的按键精灵,电脑端
结合adb具有一定识别能力的脚本,手机端
以及其他
2020年09月22日 10点09分 8
level 13
自学的?
2020年09月22日 11点09分 9
python是自学的啊,不然也不会这么杂
2020年09月22日 11点09分
看私信
2020年09月22日 11点09分
1