Сделал свою первую игру на Паскале. Зацените.
Нажмите для просмотра прикрепленного файла
a:=random(6+1);замени на
a:=random(6) + 1;
-----
|0 0|
| 0 |
|0 0|
-----
while keypressed do readkey;
repeat
readkey
until not keypressed;
uses crt;
procedure Picture(n:integer);
var
x,y,i,j:integer;
c:char;
procedure Put(i,j:integer);
begin
GotoXY(x+i,y+j);Write(с )
end;
begin
x:=WhereX;
y:=WhereY;
c:='|';
for i:=1 to 5 do begin
Put(0,i);Put(8,i)
end;
c:='-';
for i:=1 to 7 do begin
Put(i,0);Put(i,6)
end;
c:='0';
repeat
case n of
1: begin Put(4,3); n:=0 end;
2: begin Put(2,1); Put(6,5); n:=0 end;
3: begin Put(4,3); n:=2 end;
4: begin Put(6,1); Put(2,5); n:=2 end;
5: begin Put(4,3); n:=4 end;
6: begin Put(6,3); Put(2,3); n:=4 end;
end
until n=0
end;
var
i:integer;
begin
ClrScr;
for i:=1 to 6 do begin
GoToXY(i*12-10,i*3);
Picture(i)
end;
readKey
end.
uses crt;
var
Lx,Ly:integer;
procedure Picture(n:integer);
const
Dice:array[1..6,1..6,1..2]of integer=
(((45,45),(0,0),(0,0),(0,0),(0,0),(0,0)),
((10,15),(75,65),(0,0),(0,0),(0,0),(0,0)),
((45,45),(10,15),(75,65),(0,0),(0,0),(0,0)),
((10,15),(75,65),(10,65),(75,15),(0,0),(0,0)),
((10,15),(75,65),(10,65),(75,15),(45,45),(0,0)),
((10,15),(75,65),(10,65),(75,15),(10,45),(75,45)));
var
x,y,i,j,k:integer;
procedure Put(c:char);
begin
GotoXY(x+i,y+j);Write©
end;
begin
x:=WhereX;
y:=WhereY;
for j:=2 to Ly-1 do begin i:=1;Put('|');i:=Lx;Put('|') end;
for i:=2 to Lx-1 do begin j:=1;Put('-');j:=Ly;Put('-') end;
x:=x+1;
y:=y+1;
for j:=1 to Ly do for i:=1 to Lx do for k:=1 to 6 do
if (Round((Lx-2)*Dice[n,k,1]/100)=i-1)and(Round((Ly)*Dice[n,k,2]/100)=j) then Put('0')
end;
var
i:integer;
begin
ClrScr;
Lx:=5;
Ly:=5;
for i:=1 to 6 do begin
GoToXY(i*12-10,i);
Picture(i)
end;
Lx:=7;
Ly:=5;
for i:=1 to 6 do begin
GoToXY(i*12-10,i+5);
Picture(i)
end;
Lx:=9;
Ly:=7;
for i:=1 to 6 do begin
GoToXY(i*12-10,i+10);
Picture(i)
end;
Lx:=11;
Ly:=7;
for i:=1 to 6 do begin
GoToXY(i*12-10,i+17);
Picture(i)
end;
readKey
end.
uses crt;
procedure Picture(n:integer);
var
c: char;
procedure Put(i,j:integer);
var x, y: integer;
begin
X := whereX; Y := wherey;
GotoXY(x+i,y+j);Write( c );
GotoXY(X, Y);
end;
var
i: integer;
const
coord: array[1 .. 3] of integer = (1, 5, 3);
begin
c:='|';
for i:=1 to 5 do begin
Put(0,i);Put(8,i)
end;
c:='-';
for i:=1 to 7 do begin
Put(i,0);Put(i,6)
end;
c:='0';
repeat
if odd(n) then Put(4, 3)
else begin
Put(2, coord[n div 2]); Put(6, 6 - coord[n div 2]);
end;
n := 2 * (pred(n) div 2);
until n=0
end;
var
i:integer;
begin
ClrScr;
for i:=1 to 6 do begin
GoToXY(i*12-10,i*3);
Picture(i)
end;
readKey
end.