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.

Apple Pascal includes a complete package of procedures and functions forproducing high-resolution (but not double high-resolution) images on themonitor screen. It is called Turtlegraphics, because it is based on theturtle algorithm devised by S. Papert, et al. at the Massachusetts Instituteof Technology. The turtle is a discrete dot on the screen, which can leave apermanent line behind it as it moves.These screen graphics operations are supported by the Apple PascalIntrinsic Program Unit TURTLEGRAPHICS. It must be available both whenyour program is compiled and when it is executed. If you include text in aturtlegraphic image, the file SYSTEM.CHARSET must also be on volume #4or #5 when your program is executed. The TURTLEGRAPHICS unit isincluded in the SYSTEM.LIBRARY file that comes with the Apple Pascalsoftware; SYSTEM.CHARSET is on the disk APPLEI:.Any program that uses the operations described in this chapter musttherefore contain the USES declarationUSES TURTLEGRAPHICS;just after its program heading.Here is a brief summary of the operations covered in the sections thatfollow:o INITTURTLE clears the screen and sets several options to their initialvalues.o GRAFMODE and TEXTMODE allow you to switch the screen displaybetween graphics and text. The image retrieved by each mode is savedwhile the other mode is active.o VIEWPORT allows you to restrict image creation to a rectangular portionof the screen.o PENCOLOR selects different colors for lines you draw.o FILLSCREEN fills the viewport with a specified color.o TURNTO and TURN orient the direction the turtle is facing.o MOVETO and MOVE make the turtle move about on the screen, leaving atrail of PEN COLOR as it goes. MO VETO directs it to a specific place;MOVE makes it go a specific distance in the direction it is facing.o TURTLEX, TURTLEY, and TURTLEANG are functions that report thecurrent position and orientation of the turtle.o SCREENBIT tells you whether a given point on the screen is part of anyimage.III-196Chapter 11: Screen Graphics

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

Saved successfully!

Ooh no, something went wrong!