Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


my first pascal program

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
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?

PostPosted: Mon Jun 18, 2007 7:37 pm    Post subject: my first pascal program Reply with quote

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.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Mon Jun 18, 2007 7:43 pm    Post subject: Reply with quote

Good work, it's not that bad.

However, it does ignore keys at time to time.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jun 18, 2007 7:57 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites