Recently Viewed: Home > The Function Game
The Function Game

The Function Game

Designed by Rebecca Bates, Minnesota State University, Mankato. Inspired by Nanette Veilleux.

Overview To KLA

Summary: Students act out the data movement of a C++ program that uses functions. One student acts as Memory (using a board) and the others act as main and other functions. Each function has a Runner to send parameters or return values as needed.

Learning Goals:

At the end of this exercise, students will...

understand that functions have no idea what is happening in other functions
see the difference between passing by value and passing by reference
have a reinforced understanding of variable storage in memory
have a better idea of the difference between a processor and data storage
have an improved appreciation for the boring tasks computers happily do

Course And Level: Introductory programming courses for languages that use functions. Students should already have a basic understanding of variable storage and have been introduced to the concepts of parameter passing.

Class Size: This has worked for class sizes 20-50. It works best when as many students as possible are doing an active component so works well in lab or discussion sections. It could scale for larger lectures by using a set of actors and the audience (acting as all-knowing beings) could advise the action.

Preparation Time: If you use the available code, prep time is less than 15 minutes for photocopying and remembering tape. Developing other code for use in this KLA would add some time.

Execution Time: This can be lengthened or shortened depending on time available but the entire exercise will probably take about 40 minutes of class time. The exercise can stop when the passing becomes obvious.

Planning For KLA
Materials: Pre-printed versions of code, names of functions and the word "memory". Tape. Scraps of paper for parameters to be passed with.

Preparation: Define code with at least three functions, one of which calls another. Have enough print outs that members of a function group will be able to read the code for their function. Handouts (or weblinks) for complete code should be available for students after the class.

As always, read this description carefully and practice the KLA before using it in class!

Execution Of KLA

Description: This is the core of your writeup. Explain step-by-step how to execute the KLA. To make this brief and clear, explain just one way to perform the KLA here (leave alternatives to the "Variants And Extra Topics" section below) and use commands. For example, say "Ask for the first person's value and announce that this is the value of the and so far" rather than "Next, you should ask for the first person's value and announce that this is the value of the and (or or if you're using that) so far." You can also attach diagrams, photos, or figures to this page and reference them by including their filenames within the Description.

Variants And Extra Topics:

Extra Topic One: describe the extra topic here

Constraints On KLA

Would your KLA work if your students had the following constraints:
Limited Vision: Yes. (Interaction via voice or in groups so reading can be facilitated.)
Limited Hearing: Yes. (Information is based in written and oral form.)
Limited Mobility: Yes. (Groups are used and/or physical location can be set up to facilitate this.)
Trouble Speaking: Yes. (Groups are used and information can be written.)
Touch Aversion: Yes. (Information is passed orally or with paper.)

Pitfalls Of KLA

Because functions are "bored", students make get bored and stop paying attention. Instructor and/or assistants need to be talking about the experience with the students so that they are aware that not doing anything at that moment is a true representation of the computer's action.

When passing information, students would prefer to shout rather than carry information. Since a goal is to have the participants move with the data, I have typically had them carry the information on bits of paper. This resulted in some students later talking about functions "printing out" values rather than passing them. Walking to the called or calling function and whispering the number may be a way to alleviate this.

Feedback And Use Notes

Feedback: add your feedback here!

Use Notes: add your use notes here!

Used Spring of 2003, 04, 05 and Fall 04 in a 50-100 person Introduction to C++ for engineers course. It did not work as well at 8am as it did in any of the offerings after noon since it requires students to be awake enough to move and do arithmetic. (Rebecca Bates)

Related Resources

You or later users of the wiki can add links (that don't fit into the text above) to related discussions, papers, repositories, examples, etc.

Powered by QwikiWiki v1.5.1 -