Kód: Vybrať všetko
Runtime error 201 at $0040D7B6
$0040D7B6
$0040D6B3
$0040B583
$0040B7F9
$00401994
$00401CFD
$00407E30Kód: Vybrať všetko
program sibenica;
uses wincrt, strings, wingraph;
var slova:text;
var cislo, i, dlzka, a, pocr, zivot:integer;
var grafmod, ovladac:smallint;
var str1, str2, sk: string;
var pismeno:char;
procedure obesenec;
begin
if zivot<=8 then begin
moveto (300, 490);
Lineto (400, 430);
end;
if zivot<=7 then begin
moveto (500, 490);
lineto (400, 430);
end;
if zivot<=6 then begin
moveto (400, 430);
lineto (400, 100);
end;
if zivot<=5 then begin
moveto (400, 100);
lineto (600, 100);
end;
if zivot<=4 then begin
moveto (600, 100);
lineto (600, 140);
end;
if zivot<=3 then begin
moveto (400, 165);
lineto (465, 100);
end;
if zivot<=2 then begin
circle (600, 160, 20);
end;
if zivot<=1 then begin
ellipse (600, 230, 1, 1, 35, 50);
end;
end;
procedure sib;
begin
str1:='a';
str2:=str1;
zivot:=9;
while str2=str1 do begin
assign (slova,'D:\Slova.txt');
ovladac:=detect;
InitGraph (ovladac, grafmod, 'D:\egavga');
obesenec;
reset (slova);
pocr:=0;
while not eof(slova) do begin
readLn(slova, sk);
pocr:=pocr+1;
end;
Close (slova);
assign (slova, 'D:\Slova.txt');
reset (slova);
randomize;
cislo:=random (pocr);
for i:=1 to cislo do begin
readln(slova, str1);
end;
str2:=str1;
dlzka:=length(str1);
str2[1]:=str1[1];
str2[dlzka]:=str1[dlzka];
for i:=2 to (dlzka-1) do begin
str2[i]:='+';
end;
moveto (400, 530);
writebuf (str2);
repeat
if str2<>str1 then begin
pismeno:=readkey;
a:=0;
for i:=2 to (dlzka-1) do begin
if pismeno=str1[i] then begin
str2[i]:=pismeno;
a:=a+1;
end;
end;
moveto (400,530);
writebuf (str2);
if (a=0) then begin
zivot:=zivot-1;
obesenec;
if zivot=0 then begin
exit;
end;
end;
end;
if str2=str1 then begin
break;
end;
until pismeno=#27;
Close (slova);
closegraph;
end;
end;
begin
sib;
closegraph;
end.
//autoeditácia príspevku (14 Mar 2010, 23:43)
A tu je navod na tuto hru, ak nepoznate:
//autoeditácia príspevku (16 Mar 2010, 22:08)Pravidlá hry Šibenica alebo Obesenec sú veľmi jednoduché. Vašou úlohou je uhádnuť podstatné meno, ktorého začiatočné a koncové písmeno poznáte. Ostatné písmená môžte postupne hádať. Každé správne uhádnuté písmeno sa zobrazí v hľadanom slove. Za každé zle uhádnuté písmeno pribudne jeden dielik na šibenici. Hádať môžete dovtedy, pokým neuhádnete celé slovo, alebo kým sa nedokreslí celá šibenica.
Tak mi prosim niekto pomozte najst chybu v tom.