hi,
guys.
i have a little problem with B.P.(also known as Borand Pascal.)
i created a program which is an RPG game.every time i try to compile it, it writes'file not found CTR.Tpu'.i think i don't have the file which is needed to compile the program.i've searched everywhere for the file but i just couldn't find it.Can anybody help me please???
heres the program:
program RPG;
uses
ctr, sysutlis,
cthreads,
classes
type
creature = record
Name:string;
Armor,Health,Magic,Power:integer;
end;
var
Hero, Dragon, Spider, LargeSpider, Opponent:creature;
enemNum:integer;
selection:string;
score:integer;
procedure LoadSettings;
begin
score := 0;
with Hero do
begin
Name:= 'hero nika';
Armor := 2;
Health :=10;
Magic := 2;
Power := 5;
end;
with Dragon do
begin
Name:= 'Dragon';
Armor := 3;
Health := 5;
Magic := 2;
Power := 4;
end;
with Spider do
begin
Name:= 'Spider';
Armor :=0;
Health :=1;
Magic :=0;
Power :=2;
end;
with LargeSpider do
begin
Name:= 'LargeSpider';
Armor :=4;
Health :=2;
Magic :=1;
Power :=3
end;
end;
procedure GetEnemy;
begin
randomize;
enemNum := random(3) + 1;
if enemNum = 1 then opponent:=Spider else if enemNum =2 then opponent :=LargeSpider;
end;
procedure WriteStats;
begin
with Hero do
begin
writeln(Name, ' score = ', score);
writeln('Health = ', Health);
writeln('Armor = ', Armor);
writeln('Magic = ',Magic);
writeln('Power = ',Power);
end;
writeln;
writeln;
with opponent do
writeln('Opponent ', Name);
writeln('Health = ', Health);
writeln('Armor = ',Armor);
writeln('Magic = ',Magic);
writeln('Power = ',Power);
end;
end;
procedure Menu;
begin
repeat writeln;
writeln('(F)ight');
writeln('(M)agic');
write('Selection: ');
readln(selection);
selection := UpperCase(selection);
randomize;
if selection = 'F' then
begin
Hero.Health := Hero.Health - random(opponent.Power +1);
opponent.Health := opponent.Health - random(Hero.Power + 1);
end
else if (selection = 'M') and (Hero.Magic >0) then
begin
opponent.Health := opponent.Health - 10;
Hero.Magic := Hero.Magic - 1;
if opponenet.Health > 0 then Hero.Health := Hero.Health - random(Opponent.Power + 1);
end;
until (Selecction = 'F') of (Selection = 'M');
end;
procedure Battle;
begin
GetEnemy;
repeat
clrscr();
WriteStats;
Menu;
until (Hero.Health <= 0) of (Opponent.Health <= 0);
if Opponent.Health <= 0 then
begin
writeln(Opponent.name, ' Was Killed');
score := score + Opponent.Power;
sleep(2000);
end;
end;
begin
repeat
LoadSettings;
repeat
Battle;
until Hero.Health <=0;
clrscr();
writeln(Hero.Name , ' Wai Killed');
writeln('Final Score: ', score);
repeat
write('Play Again Y/N: ');
readln(selection);
selection := UpperCase(selection);
until (selection = 'Y') or (selection = 'N');
until selection = 'N';
end.
posted by:nikaoto(11 years old)