13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MOVETO takes an X (horizontal) parameter in the range 0 .. 279 and a Y(vertical) parameter in the range 0 .. 191. It sends the turtle to those screencoordinates without changing its orientation. As it moves it draws a line ofthe current PENCOLOR value.MOVE accepts an integer value, representing a vector distance on thescreen. The turtle moves that distance in the direction it is facing, leaving atrail of the current PEN COLOR value.With movements at an angle from horizontal or vertical, the integer usedwith MOVE seldom places the turtle exactly at a position with integercoordinates. When the turtle arrives at a place not definable by integercoordinates, Pascal adjusts its position to the nearest integral point. For thisreason, a series of MOVE and TURN or TURNTO procedures may fail tocreate a closed polygon. A final adjustment with MO VETO may benecessary.Here is a sample program that uses some of the procedures discussed so far.It draws an equilateral triangle, pointing downward, near the center of thescreen and displays it until you press RETURN:PROGRAM TRIAHGLE;USES TURTLEGRAPHICS;BEGIHIHI TTURTLE;MOVETO C14B, 75>;TURHTD CGB>;PEHCOLOR CWHITE>;MOVE CSB>;TURH C12B>;MOVE CSB>;TURH C12B>:MOVE CSB>;READLHEHD.The READLN procedure is included only because otherwise this shortprogram would terminate and restore TEXTMODE before you have achance to see the image it generates.III-202Chapter 11: Screen Graphics

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!