Solved

i need to know

Posted on 1998-10-17
6
160 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTTP-POST Delphi 7 5 2,915
.dat problems 39 204
my activex application give System Error.  Code: 5.  Access is denied 16 122
Copy file in dll not working but working on exe ! 18 93
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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