Solved

i need to know

Posted on 1998-10-17
6
154 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
  • 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now