Nifty Assignments - SIGCSE 2007


David Reed
Creighton University

Summary This series of assignments involves designing and implementing programs that display ASCII animations.
Topics An ASCIImation is an animation in which the individual frames are composed of standard keyboard characters. This page describes three different assignments that involve designing and constructing programs for displaying ASCIImations.
Audience The first version described is perfect for a CS0 course using HTML/JavaScript. The second version is designed for a CS2 course in Java, or perhaps the end of a CS1 course that emphasizes GUI building. Version 3 could be used in a Web Programming course that integrates server-side and client-side programming.
Strengths The great strength of these assignments is that they are fun and stimulate creativity. Assignments can be tailored to address several programming/design concepts at different levels of the curriculum.
Weaknesses Since these assignments do utilize some advanced language features (timeouts in JavaScript, TimerTasks in Java, and file/directory processing in PHP), they may require careful introduction. The resulting programs are also fairly short.
Dependencies Version 1 of the ASCIImation player requires a basic understanding of HTML and enough familiarity with JavaScript to integrate the provided code. Version 2 requires a fairly strong understanding of Java (or possibly another high-level language), including the ability to design and build GUIs. Version 3 requires a deeper understanding of client-side and server-side programming, along with access to a PHP-enabled server.

In an age of 3-D graphics and video games, what could be more retro than returning to the olden days of ASCII art? Pictures made up of typed or printed characters have existed for more than a century, but became widespread in the 1970's and 1980's due to character-based monitors and the growth of the Internet. Known as ASCII art, these character-based pictures commonly appeared at the end of emails and were the basis of today's emoticons. The term ASCIImation, to describe animations made up of ASCII art, was coined in 1997 on the Star Wars ASCIImation site (where the original Star Wars movie is being recreated in ASCII).

From a teaching perspective, ASCIImations are ideal for demonstrating different programming concepts across a variety of courses. They can be used in a non-majors course to motivate the development of interactive Web pages (using HTML and JavaScript). They can be used to demonstrate threads, events, and GUI-building in a CS1/CS2 course. Finally, they can be used in an upper-level Web Programming course to integrate client-side and server-side programming techniques. Beyond utility, however, ASCIImations are fun and engaging to students who show creativity in designing their own movies.

ASCIImations in CS0

At Creighton University, like many institutions, we offer a non-majors course that mixes the fundamentals of programming with broader topics in computing. Our course uses HTML and JavaScript, so that programming concepts are couched in the form of interactive Web pages. As a result, we are able to build upon the students' familiarity with the Web interface, and develop simple but professional-looking programs using only a text editor and Web browser.

Even with limited programming experience, students in the non-majors course are capable of building an interactive Web page for entering and displaying ASCIImations. Students are given a sample screen shot, and must select and place the correct elements (text areas, buttons, and text) in the page, as well as integrate provided JavaScript code for displaying the animation. As an important part of the assignment, students are required to design and create their own animations, which they can then play in their pages. The creative side of this project is appealing to the students, most of whom are from non-technical backgrounds. Designing and creating an animation is fun and allows even the weaker students to show their creativity.

ASCIImations in CS1/CS2

ASCIImations can also be the basis for an assignment in a CS2 course, or late in a CS1 course that emphasizes GUI-building. In a recent CS2 course, I showed students the Web-based ASCIImation player from CS0 and assigned them the task of building a Java application that could play animations stored as files. Students were given minimal requirements (the ability to load an animation file, play it, and pause) and encouraged to incorporate additional features (e.g., a progress bar, animation speed control). For developing the GUI, students used the GUI Builder that is incorporated into NetBeans, but this assignment could also be used in a course where GUI building was done from scratch. Students were provided some hints as to how to set TimerTasks in Java, but part of the assignment involved having to access the Java documentation and figure out how to schedule the animation steps.

ASCIImations in Web Programming

While students enjoy developing an ASCIImation application and creating their own animations, they lament the fact that their application cannot be accessed via the Web. This leads to a discussion on the differences between a Java application and an applet, and the fact that file access is restricted with applets. I use this discussion as an opportunity to plug our Web Programming course, which includes server-side programming in PHP. A full-featured, Web-based program was used as the basis for a recent independent study assignment, and will be used in the Web Programming course this fall.

ASCIImations for Fun

Because ASCIImations are visual and don't require technical knowledge to create them, they can also be used outside of the classroom as a public relations boost. At Creighton, we are currently running a university-wide ASCIImation contest, where any student can create and submit an animation. The contest is co-sponsored by the Department of Computer Science and the Department of Journalism and Mass Communication (home of the Graphic Design program). Through emails, Web posting, and campus flyers, students were notified of the contest, thus raising awareness of the CS program and the Interactive Web Development minor recently introduced.

Be sure to check out my Nifty Panel Talk.

Extra info about this assignment: