哪里错了
freepascal吧
全部回复
仅看楼主
level 5
rt
正在编一个扫雷,结果突然错掉了
2016年12月14日 12点12分 1
level 5
var
x:array[1..20,1..20]of integer;
i,c,u,j:integer;
q,w:integer;
s:array[1..20,1..20]of boolean;
begin
for i:=1 to 20 do
for j:=1 to 20 do begin
randomize;
x[i,j]:=random(3);
if x[i,j]>0 then x[i,j]:=1
else inc(u);
end;
for i:=1 to 20 do begin
for j:=1 to 20 do if s[i,j]=false then write('█')
else begin
if x[i,j]<1 then begin write('×');u:=0;end;
if x[i,j]=1 then begin
if x[i+1,j]=0 then c:=c+1;
if x[i+1,j+1]=0 then c:=c+1;
if x[i+1,j-1]=0 then c:=c+1;
if x[i,j+1]=0 then c:=c+1;
if x[i,j-1]=0 then c:=c+1;
if x[i-1,j+1]=0 then c:=c+1;
if x[i-1,j]=0 then c:=c+1;
if x[i-1,j-1]=0 then c:=c+1;
write(c);
end
end
writeln;
end;
while u>0 do begin
read(q,w);
s[q,w]:=true;
for i:=1 to 20 do begin
for j:=1 to 20 do if s[i,j]=false then write('█')
else begin
if x[i,j]<1 then begin write('×');u:=0;end;
if x[i,j]=1 then begin
if x[i+1,j]=0 then c:=c+1;
if x[i+1,j+1]=0 then c:=c+1;
if x[i+1,j-1]=0 then c:=c+1;
if x[i,j+1]=0 then c:=c+1;
if x[i,j-1]=0 then c:=c+1;
if x[i-1,j+1]=0 then c:=c+1;
if x[i-1,j]=0 then c:=c+1;
if x[i-1,j-1]=0 then c:=c+1;
write(c);
end
end
writeln;
end;
end;
readln;
end.
2016年12月14日 12点12分 2
level 2
var
x:array[1..20,1..20]of integer;
i,c,u,j:integer;
q,w:integer;
s:array[1..20,1..20]of boolean;
begin
for i:=1 to 20 do
for j:=1 to 20 do begin
randomize;
x[i,j]:=random(3);
if x[i,j]>0 then x[i,j]:=1
else inc(u);
end;
for i:=1 to 20 do begin
for j:=1 to 20 do if s[i,j]=false then write('█')
else begin
if x[i,j]<1 then begin write('×');u:=0;end;
if x[i,j]=1 then begin
if x[i+1,j]=0 then c:=c+1;
if x[i+1,j+1]=0 then c:=c+1;
if x[i+1,j-1]=0 then c:=c+1;
if x[i,j+1]=0 then c:=c+1;
if x[i,j-1]=0 then c:=c+1;
if x[i-1,j+1]=0 then c:=c+1;
if x[i-1,j]=0 then c:=c+1;
if x[i-1,j-1]=0 then c:=c+1;
write(c);
end
end;
writeln;
end;
while u>0 do begin
read(q,w);
s[q,w]:=true;
for i:=1 to 20 do begin
for j:=1 to 20 do if s[i,j]=false then write('█')
else begin
if x[i,j]<1 then begin write('×');u:=0;end;
if x[i,j]=1 then begin
if x[i+1,j]=0 then c:=c+1;
if x[i+1,j+1]=0 then c:=c+1;
if x[i+1,j-1]=0 then c:=c+1;
if x[i,j+1]=0 then c:=c+1;
if x[i,j-1]=0 then c:=c+1;
if x[i-1,j+1]=0 then c:=c+1;
if x[i-1,j]=0 then c:=c+1;
if x[i-1,j-1]=0 then c:=c+1;
write(c);
end
end;
writeln;
end;
end;
readln;
end.
有两个分号没加
2016年12月16日 12点12分 3
10祭上没有用,一直卡
2017年03月25日 09点03分
level 5
ok,好的
2016年12月17日 11点12分 4
1