Interactivity


In this assignment, you will write a program in C that implements an interactive game, simulation, story, calculator, mad lib, or conversation.

Requirements

Your program must make use of both the standard input and output streams to interact with a user. Your program must keep track of one or more variables that change based on what the user says, and which influence the behavior of the program. You do not have to use any other particular language features (functions, structures, conditionals, loops, etc.) but you may.

This description allows for a very simple program that prompts the user for a value, calculates something based on it, and prints the result. That would be acceptable. There is also a lot of room to go further with this, and I encourage you to explore something that you find interesting and challenging within the scope of what you can accomplish in one week.

Submit your work in the form of a .tar.gz archive that unpacks to contain a directory with the same name as the archive with the extension removed. All of your files must be in that directory, including a Makefile such that make builds your program, and make clean deletes any files produced by the build. If you want, there may also be a text or pdf file that describes your program and anything a user might want to know about how to use it.

Sources of ideas

You may base your idea on a description or code you find, and even refer to existing source code to guide the design of your work, but in the end you must set other material aside and write your own program. If you use any found material in any way, you must cite it. Citations can appear in the source code in comments, or collected in another file in your project directory. You may use any citation format, as long as it includes the title (if applicable), author, and a reference such as a link that is sufficient for somone else to find a published copy of the work. You might also include a brief description of how you used the source.

A personal addendum

I have a copy of a famous computer book, ‘101 BASIC Computer Games’, which at one point had sold more copies than there were personal computers in existence—such was the popularity of the BASIC language, and this book in particular, back when people were first figuring out what to do with a computer in their house. Back in those days, it was common to distribute ‘type-in’ programs, i.e. programs where they printed out the source code and published it in a book or magazine and users could manually type the code into their own computers to run it. I remember fondly how copying some of these programs and then changing them for myself was an important part of how I learned to program.

I have long wanted to go back through it and translate some of the better games and simulations into C or C++ for my current students to learn from. This would have to be a fairly open-ended project. For one thing, not all of the entries in ‘101 BASIC Computer Games’ have aged well, or really ought to have been considered acceptable at the time. Some embody systems of oppression such as racism, misogyny, fatphobia, etc., and although I think the work remains valuable as a whole, I don't really want to perpetuate those ones. For another thing, BASIC and C are rather different languages, and different things are considered interesting to do with computers in 2022 than seemed interesting in 1973.

So, if you wanted to come by my office and look at a piece of history, or if you just wanted to read a version online, and translate a program from it that seems interesting to you, I would love to see what you come up with.

The discussion board would be a great place to talk about the good and bad things you find in the book, suggestions you hope somebody would do even though you're going to do something else, questions about history, or whatever. I'd also be happy to talk one-on-one about this resource if you prefer.

Of course, this is just an addendum—the assignment is its own thing, and you can come up with your ideas from anywhere. But if this seems like an interesting starting point, I offer it to you.