ACM Home Page
Please provide us with feedback. Feedback
Graphics for free
Full text PdfPdf (486 KB)
Source ACM SIGCSE Bulletin archive
Volume 31 ,  Issue 2  (June 1999) table of contents
COLUMN: Reviewed papers table of contents
Pages: 65 - 68  
Year of Publication: 1999
ISSN:0097-8418
Author
Martin C. Carlisle  US Air Force Academy, Colorado
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 0,   Downloads (12 Months): 3,   Citation Count: 2
Additional Information:

abstract   references   cited by   collaborative colleagues   peer to peer  

Tools and Actions: Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/571535.571572
What is a DOI?

ABSTRACT

Students find computer graphics one of the most interesting topics in computer science. Unfortunately, writing programs with graphics requires understanding concepts that are usually beyond the scope of an introductory computer science course. For example, in Windows 95, a program that uses graphics must have an event loop that dispatches messages to the appropriate handler. Event loops, messages, and handlers are well beyond the grasp of someone just learning about variables! Consequently, programming assignments for introductory courses tend to use no graphics, or simple ANSI graphics (see, e.g. Feldman and Koffman [1]). These programs compare unfavorably to the graphics of games most students are accustomed to using, and motivation to program in an introductory course may be lost.Ideally, we would like to be able to have students write programs that have more appealing interfaces, yet do not require a large amount of additional conceptual complexity. In fact, the best case would be to have the student write a program as if it were a simple text-based program, and have the compiler automatically add a graphical interface. Languages that provide overloading, such as Ada 95, allow us to accomplish precisely that.This paper describes a library, Graphics_110 (named in honor of our introductory course, CS 110), which, using overloading, replaces the standard I/O libraries in Ada 95 (Ada.Text_IO, Ada.Float_Text_IO, and Ada.Integer_Tex_IO). By following a simple contract and replacing calls to the standard libraries with calls to Graphics_110, the student obtains a program with a Windows-style interface without ever having to worry about the implementation details. Although we use Ada 95 for this paper, the ideas extend to any programming language that provides subtypes and overloading.The next section describes the "contract" the programmer must follow to use the library and the third section describes the implementation of Graphics_110. In each section, we describe how we used Graphics_110 with a battleship game implemented in our introductory course. The final section presents conclusions and ideas for future work.




Peer to Peer - Readers of this Article have also read: