Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

i need to know

Posted on 1998-10-17
6
Medium Priority
?
178 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 100 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 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