Félkarú rabló Pascalban,elakadtam a végénél,pls HELP!
Sziasztok!
Elakadtam a félkarú rablóm tervezésének végénél. Turbo Pascal 7-ben készítem.
Íme a progi:
program jatekgep;
uses crt;
var penz,tet,nyeremeny: integer;
grafika: array[1..5,1..3] of char;
sor: array [1..3,1..3] of byte;
i,j: integer;
begin
clrscr;
{ Grafika }
textmode(1); textcolor(3);
textbackground(4);
gotoxy(1,10);
for i:=1 to 5 do
begin
for j:=1 to 3 do
begin
grafika[i,j]:=' ';
write(grafika[i,j], ' ');
end;
writeln;
end;
textbackground(black);
textcolor(9);
gotoxy(8,12);
write('<-');
textcolor(lightgreen);
gotoxy(11,12);
write('Nyerösor');
{ Tét , Pénz }
penz:=1000;
tet:=50;
textcolor(7);
gotoxy(24,5);
writeln('Pénz: ');
gotoxy(31,5);
textcolor(4);
write(penz);
gotoxy(25,7);
textcolor(7);
writeln('Tét: ');
gotoxy(31,7);
textcolor(4);
write(tet);
{ Pörgetés }
gotoxy(5,25);
textcolor(8);
writeln('Pörget : ENTER / Kifizet : ESC');
repeat
until readkey=#13;
repeat
If Readkey=#13 then
begin
textcolor(yellow);
gotoxy(1,10);
for i:= 1 to 3 do
begin
for j:= 1 to 3 do
begin
randomize;
textbackground(7);
sor[1,1]:=random(1-0+1);
sor[1,2]:=random(1-0+1);
sor[1,3]:=random(1-0+1);
sor[2,1]:=random(1-0+1);
sor[2,2]:=random(1-0+1);
sor[2,3]:=random(1-0+1);
sor[3,1]:=random(1-0+1);
sor[3,2]:=random(1-0+1);
sor[3,3]:=random(1-0+1);
write(sor[i,j], ' ');
end;
writeln;
end;
{ Feltételek }
textbackground(black);
If (sor[2,1]=1) and (sor [2,2]=1) and (sor[2,3]=1) then
begin
gotoxy(13,19);
textcolor(7);
writeln('Nyeremény: ');
gotoxy(24,19);
textcolor(4);
write('150');
penz:=penz+150;
gotoxy(31,4);
textcolor(4);
clreol;
write(penz);
end
else
begin
penz:=penz-50;
gotoxy(13,19);
textcolor(black);
writeln('Nyeremény: ');
gotoxy(24,19);
write('200');
gotoxy(31,4);
textcolor(4);
clreol;
write(penz);
end;
If (sor[2,1]=0) and (sor [2,2]=0) and (sor[2,3]=0) then
begin
gotoxy(13,19);
textcolor(7);
writeln('Nyeremény: ');
gotoxy(24,19);
textcolor(4);
write('100');
penz:=penz+150;
gotoxy(31,4);
textcolor(4);
clreol;
write(penz);
end;
{ Kifizetés , programozó neve és programozási felület kiírása }
If readkey=#27 then
begin
clrscr;
gotoxy(11,3);
textcolor(7);
write('Kifizetés : ');
textcolor(4);
write(penz);
write(' Ft');
gotoxy(2,10);
textcolor(7);
write('A programot készítette : ');
textcolor(4);
write('Lacboy');
gotoxy(2,13);
textcolor(7);
write('Programozási felület : ');
textcolor(4);
write('Turbo Pascal 7');
delay(4000);
exit;
end;
end;
{ Pörgetés ameddig van pénzem }
until penz=0;
{ Pénz elfogyása esetén programozó neve és programozási felület kiírása }
If penz=0 then
begin
clrscr;
gotoxy(2,10);
textcolor(7);
write('A programot készítette : ');
textcolor(4);
write('Lacboy');
gotoxy(2,13);
textcolor(7);
write('Programozási felület : ');
textcolor(4);
write('Turbo Pascal 7');
delay(8000);
exit;
end;
end.
Az a gond,hogy amikor pörgetek mindenegyes alkalommal 2x kell az ENTER-t leütnöm,hogy pörgessen...
Kérlek titeket segítsetek ebben! Nem értem mi a fene baja lehet...
Előre is köszi!
Üdv. Laci