Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Please help for a small simulation! Posted by srknytgn on 21 May 2009 at 1:57 PM
Hi,

I have an assignment like how a user move in a room. I draw the sketch on Turbo Pascal 7, but i couldn't move the person in the room. I have to make confirm pc user to where the person will go first and then the other question same again and finally when it's completed I need an output like what was the movement looks like.

Please specify if i couldn't tell the problem exactly.



program oda;
uses dos,crt,printer,graph;
var graphdriver,graphmode:integer;
begin;
graphdriver:=detect;
initgraph(graphdriver,graphmode,'c:\progra~1\tp\bgi\');
{walls}
line(100,100,100,400);
line(100,400,400,400);
line(400,100,100,100);
line(400,100,400,110);
line(400,400,400,190);

{bed}
rectangle(110,300,300,390);
settextstyle(1,horizdir,1);
outtextxy(115,360,'yatak');


rectangle(110,250,150,290);


{desk}
rectangle(110,110,240,170);
outtextxy(115,145,'masa');

{chair}
rectangle(155,175,195,215);

{closet}
rectangle(350,390,390,220);
settextstyle(1,vertdir,1);
outtextxy(365,330,'dolap');

{door}
line(400,110,320,110);


arc(400,110,180,270,80);

{person}
rectangle(420,120,460,160);
circle(440,140,10);



readln;
end.

Report
Re: Please help for a small simulation! Posted by w0lfg4 on 23 May 2009 at 3:07 PM
You´ll need to break the display down to procedures what takes parameters - the coordinates of your objects. Like:
Procedure Bed(x,y:integer);

Begin
 Rectangle(x,y,x+100{Bed lenght},y+50{Bed width});
 OutTextXY(x+3,y+11,´Bed´);
End;

I suggest to read through this: http://www.programmersheaven.com/mb/pasprog/388454/388454/graphic-help/?S=B20000#388454 Lots of good stuff about animation
Report
Re: Please help for a small simulation! Posted by w0lfg4 on 23 May 2009 at 3:08 PM
Duplicate post
Report
Re: Please help for a small simulation! Posted by w0lfg4 on 23 May 2009 at 3:08 PM
Duplicate post, Arrrgghh....



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.