主题:大家来猜
zhangyuan
[专家分:630] 发布于 2006-12-17 14:38:00
pascal不能做的是( )?
谁说pascal不能做的是(计算)?[em18][em18][em18][em18][em18][em20][em20][em20][em20]
回复列表 (共21个回复)
11 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:46:00
end;
procedure b2; {o,W}
begin
textcolor(white);
ch:=readkey;
while not((ch='0')and(a[x,y]='+')) do
begin
if ch='q' then begin f:=false;exit;end;
if ch='6' then inc(y,2)
else if ch='5' then inc(x)
else if ch='4' then dec(y,2)
else if ch='8' then dec(x);
gotoxy(y,x);
ch:=readkey;
end;
write('o');
writeln(t,'W ',x,' ',y,';');
a[x,y]:='W';
gotoxy(y,x);
end;
procedure b3; {o,W}
var a2,b,c,d:integer;
label lab,lab2,lab3;
begin
textcolor(white);
ch:='+';
for i:=1 to 30 do
for j:=1 to 79 do
begin
a2:=0;
b:=0;
c:=0;
d:=0;
for k:=1 to 3 do
begin
if (a[i,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(a2);
if (a[i+k,j]=a[i,j])and (a[i,j] in ['B','W']) then inc(b);
if (a[i+k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc?;
if (a[i-k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(d);
end;
{if i*j=1 then begin
write(t,(a[i,j+k*2]=a[i,j])and (a[i,j] in ['o','*']));
write(t,a[i,j]);
write(t,a2);
end;}
if a2 in [3] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab;end;
if b in [3] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab;end;
if c in [3] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab;end;
if d in [3] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab;end;
end;
lab:
{write(t,'{ok1,1');}
if (a2=3)and(a[i,j-2]='+') then y:=j-2
else if (a2=3)and(a[i,j+8]='+') then y:=j+8
else if (b=3)and(a[i-1,j]='+') then x:=i-1
else if (b=3)and(a[i+4,j]='+') then x:=i+4
else if (c=3)and(a[i-1,j-2]='+') then begin x:=i-1;y:=j-2;end
else if (c=3)and(a[i+4,j+8]='+') then begin x:=i+4;y:=j+8;end
else if (d=3)and(a[i+1,j-2]='+') then begin x:=i+1;y:=j-2;end
else if (d=3)and(a[i-4,j+8]='+') then begin x:=i-4;y:=j+8;end
else
12 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:46:00
begin
for i:=1 to 30 do
for j:=1 to 79 do
begin
a2:=0;
b:=0;
c:=0;
d:=0;
for k:=1 to 3 do
begin
if (a[i,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(a2);
if (a[i+k,j]=a[i,j])and (a[i,j] in ['B','W']) then inc(b);
if (a[i+k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc?;
if (a[i-k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(d);
end;
{if i*j=1 then begin
write(t,(a[i,j+k*2]=a[i,j])and (a[i,j] in ['o','*']));
write(t,a[i,j]);
write(t,a2);
end;}
if a2 in [2] then for k:=1 to 3 do if a[i,j+k*2]='+' then begin y:=j+k*2;goto lab2;end;
if b in [2] then for k:=1 to 3 do if a[i+k,j]='+' then begin x:=j+k;goto lab2;end;
if c in [2] then for k:=1 to 3 do if a[i+k,j+k*2]='+' then begin x:=i+k;y:=j+k*2;goto lab2;end;
if d in [2] then for k:=1 to 3 do if a[i-k,j+k*2]='+' then begin x:=i-k;y:=j+k*1;goto lab2;end;
end;
13 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:47:00
lab2:
{write(t,'{ok1,1');}
if (a2<>2)and(b<>2)and(c<>2)and(d<>2)
then
begin
for i:=1 to 30 do
for j:=1 to 79 do
begin
a2:=0;
b:=0;
c:=0;
d:=0;
k:=1;
begin
if (a[i,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(a2);
if (a[i+k,j]=a[i,j])and (a[i,j] in ['B','W']) then inc(b);
if (a[i+k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc?;
if (a[i-k,j+k*2]=a[i,j])and (a[i,j] in ['B','W']) then inc(d);
end;
{if i*j=1 then begin
write(t,(a[i,j+k*2]=a[i,j])and (a[i,j] in ['o','*']));
write(t,a[i,j]);
write(t,a2);
end;}
if a2 in [1] then begin ch:=a[i,j];{write(t,'{ok1 ');}goto lab3;end;
if b in [1] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab3;end;
if c in [1] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab3;end;
if d in [1] then begin ch:=a[i,j];{write(t,' {ok1 ');}goto lab3;end;
end;
lab3:
{write(t,'{ok1,1');}
if (a2=1)and(a[i,j-2]='+') then y:=j-2
else if (a2=1)and(a[i,j+4]='+') then y:=j+4
else if (b=1)and(a[i-1,j]='+') then x:=i-1
else if (b=1)and(a[i+2,j]='+') then x:=i+2
else if (c=1)and(a[i-1,j-2]='+') then begin x:=i-1;y:=j-2;end
else if (c=1)and(a[i+2,j+4]='+') then begin x:=i+2;y:=j+4;end
else if (d=1)and(a[i+1,j-2]='+') then begin x:=i+1;y:=j-2;end
else if (d=1)and(a[i-2,j+4]='+') then begin x:=i-2;y:=j+4;end;
end;
end;
if not(a[x,y]='+') then
repeat
inc(x,random(5)-random(5));
inc(y,random(5)-random(5));
until a[x,y]='+';
{write(t,'ok2');}
gotoxy(y,x);
write('o');
writeln(t,'W ',x,' ',y,';');
a[x,y]:='W';
gotoxy(y,x);
{ write(t,'{ok3:',x,y,''); }
end;
14 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:47:00
begin
fillchar(a,sizeof(a),' ');
textbackground(lightgreen);
textcolor(lightred);
assign(t,'five.txt');
rewrite(t);
writeln('One or two player?');
repeat ch:=readkey;until ch in['1','2'];
gotoxy(1,1);
for i:=1 to 30 do
begin
write('+');
for j:=1 to 39 do write('-+');
writeln;
end;
for i:=1 to 30 do
for j:=1 to 79 do
if odd(j) then a[i,j]:='+'
else a[i,j]:='-';
gotoxy(1,1);
x:=1;
y:=1;
f:=true;
if ch='2' then
while f do
begin
b1;
go(c,a);
{ write(t,' ',c,' '); }
if c='B' then
begin
writeln('Black win!!!');
ch:=readkey;
writeln(t);
writeln(t,'Black win');
break
end
else if c='W' then
begin
writeln('White win!!!');
ch:=readkey;
writeln(t);
writeln(t,'White win');
break;
end;
if not f then break;
b2;
go(c,a);
if c='B' then
15 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:47:00
begin
writeln('Black win!!!');
textcolor(black);
ch:=readkey;
writeln(t,'Black win');
break;
end
else if c='W' then
begin
writeln('White win!!!');
ch:=readkey;
writeln(t,'White win');
break;
end;
end
else
while f do
begin
b1;
go(c,a);
{ write(t,' ',c,' '); }
if c='B' then
begin
writeln('You won!!!');
ch:=readkey;
writeln(t);
writeln(t,'Black win');
break
end
else if c='W' then
begin
writeln('You lose!!!');
ch:=readkey;
writeln(t);
writeln(t,'Black win');
break;
end;
if not f then break;
b3;
go(c,a);
if c='B' then
begin
writeln('You won!!!');
ch:=readkey;
writeln(t);
writeln(t,'Black win');
break
end
else if c='W' then
begin
writeln('You lose!!!');
ch:=readkey;
writeln(t);
writeln(t,'Black win');
break;
end;
end;
close(t);
close(output);
assign(output,'five.txt');
append(output);
writeln;
writeln;
for i:=1 to 30 do
begin
for j:=1 to 79 do
write(a[i,j],' ');
writeln;
end;
close(output);
end.
16 楼
lrc007 [专家分:30] 发布于 2006-12-17 12:47:00
作者: overture_wy
17 楼
blackmark [专家分:210] 发布于 2006-12-20 13:30:00
都可以
19 楼
angwuy [专家分:2280] 发布于 2007-01-04 17:27:00
我觉得不能做的只有上网了
20 楼
小田甜 [专家分:3910] 发布于 2007-01-20 21:36:00
[url=http://upload.programfan.com/upfile/200701202132863.zip]我作的泡泡龙[/url]
计算:计算分数
玩游戏:不解释
播放图片:打印Next.bmp;Score.bmp;...
听音乐:运行时按Crtl-S可以打开,虽然像是噪音,但不影响程序运行
你道是说说哪个不行?
我来回复