Nothing Special   »   [go: up one dir, main page]

skip to main content
article
Free access

Graphics for free

Published: 01 June 1999 Publication History

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.

References

[1]
Feldman, M. and Koffman, E. Ada 95: Problem Solving and Program Design, Second Edition. Addison-Wesley, Reading, Mass., 1996.
[2]
Ousterhout, J. Tcl and the Tk Toolkit, Addison-Wesley, Reading, Mass., 1994.
[3]
Westley, T. TASH: A Free Platform-Independent Graphical User Interface Development Toolkit for Ada. In Proceedings of Tri-Ada '96. (1996), 165-178.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGCSE Bulletin
ACM SIGCSE Bulletin  Volume 31, Issue 2
June 1999
93 pages
ISSN:0097-8418
DOI:10.1145/571535
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 June 1999
Published in SIGCSE Volume 31, Issue 2

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)6
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2001)Teaching computer science with robotics using Ada/Mindstorms 2.0Proceedings of the 2001 annual ACM SIGAda international conference on Ada10.1145/507574.507592(73-78)Online publication date: 30-Sep-2001
  • (2001)Teaching computer science with robotics using Ada/Mindstorms 2.0ACM SIGAda Ada Letters10.1145/507546.507592XXI:4(73-78)Online publication date: 30-Sep-2001
  • (2000)Object-orientation in Java for scientific programmersACM SIGCSE Bulletin10.1145/331795.33188532:1(357-361)Online publication date: 1-Mar-2000
  • (2000)Object-orientation in Java for scientific programmersProceedings of the thirty-first SIGCSE technical symposium on Computer science education10.1145/330908.331885(357-361)Online publication date: 1-May-2000

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media