 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon Jun 18, 2007 7:37 pm Post subject: my first pascal program |
|
|
Ok, I made my first pascal file. It is completely useless but I just felt like making it. It is based of the one from riddlersoft.com because I am sick and can't think well so I couldn't think it out in my mind. Anyway here is the file. And if you want the source code its this.
KEY
base = just changed some stuff
| Code: |
program Elevator;
uses crt;
type the_elevator_your_on = object
private
floor, maximum_floor, minimum_floor : integer;
public
procedure create(fl,maf,mif : integer);
procedure moveup;
procedure movedown;
procedure currentfloor;
end;
procedure the_elevator_your_on.create(fl,maf,mif : integer);
begin
floor:=fl;
maximum_floor:=maf;
minimum_floor:=mif
end;
procedure the_elevator_your_on.moveup;
begin
if (floor<maximum_floor) then
floor:=floor+1
else
begin
clrscr;
write('You are on the top floor');
end;
end;
procedure the_elevator_your_on.movedown;
begin
if (floor>minimum_floor) then
floor:=floor-1
else
begin
clrscr;
write('You are already on the lowest floor');
end;
end;
procedure the_elevator_your_on.currentfloor;
begin
clrscr;
write('The floor that your elevator is currently on is ',floor,'.');
end;
var lift1 : the_elevator_your_on;
i : char;
begin
lift1.create(10,15,1);
while (i<>'q') and (i<>'Q') do
begin
if (keypressed) then
i := readkey;
i := readkey;
clrscr;
write('Enter your option"u", "d", or "s"');
case i of
'u' : lift1.moveup;
'd' : lift1.movedown;
's' : lift1.currentfloor;
end;
end;
end.
|
Heh, yea that is what base means, when I'm not sick I will actually make something useful and not "based" of something else.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Mon Jun 18, 2007 7:43 pm Post subject: |
|
|
Good work, it's not that bad.
However, it does ignore keys at time to time.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon Jun 18, 2007 7:57 pm Post subject: |
|
|
W/e. Read my key.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|