Solved

i need to know

Posted on 1998-10-17
6
169 Views
Last Modified: 2010-04-16
how to use graphics in pascal. im learn pascal in school and the text book doesnt mention anything nor does my teacher know how to create grpahics. please email me.
stupidguy23@hotmail.com
0
Comment
Question by:stupidguy23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
scrapdog earned 50 total points
ID: 1215800
You didn't specify which version of pascal, so I am going to assume Turbo Pascal.

Since you are learning, the best thing to use for now is turtle graphics, because there is no red tape.

include this line in the beginning of your program:

uses graph3, crt;


Here are some commands of interest to you:

GraphColorMode;      turns on graphics mode
TextMode(c80);       restores to text mode
Forwd(xxx);          moves turtle forward xxx pixels
Back(xxx);           moves turtle back xxx pixels
TurnLeft(xxx);
TurnRight(xxx);      turns turtle xxx degrees
PenUp;
PenDown;             picks up or puts down turtles pen
Home;                returns turtle to home position
SetPenColor(x);      sets color to x
HideTurtle;
ShowTurtle;          hides or shows turtle

Check the help file for the graph3 unit for more commands.  Put your cursor over the "graph3" in your source code and press ctrl-f1 to get to it.

Demo program that draws a square:

program demo;

uses graph3, crt;

begin
  GraphColorMode;
  PenUp;
  Home;
  SetPenColor(1);
  PenDown;
  Forwd(100);
  TurnRight(90);
  Forwd(100);
  TurnRight(90)
  Forwd(100);
  TurnRight(90);
  Forwd(100);
  readln;
  TextMode(c80);
end.
 

For more advanced info on graphics, this site might help you:

http://magic.hurrah.com/~sabre/graphpro/


scrappy
0
 
LVL 1

Expert Comment

by:FuzzyLogic
ID: 1215801
Scrappy, I think it will help SG23 more if you will give him some information about graph.tpu unit (InitGraph() and all that stuff).
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1215802
I was considering doing that, but you can't dive right into it like you can with graph3.  I think graph3 is better for learning if you have never programmed graphics before.

Stupid:  If you are interested in using the graph.tpu unit, check it out in the help file.  There is more help on it than there is on graph3, but it is more technical.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:stupidguy23
ID: 1215803
Its think pascal and im sure the macs we use i kinda old (5 or more years at least). i'll be back with a version of think and the model of the mac.
0
 

Author Comment

by:stupidguy23
ID: 1215804
and give me a url or site or something for more explainations and something to give my teacher for better understanding.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1215805
I assumed you were using Turbo Pascal.  If you are using Think, I can't help you out, because I never used it!!  That URL I gave you will be of some help to you, as it covers some generic graphics concepts.  How you would implement this in Think, I don't know.  However, if I stumble across a site for using graphics w/ Think I will post it here or e-mail you.

scrappy

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question