Flying Flashcards

Sometimes we study for a test using FlashCards. Typically the cards have a question on the front and an answer on the back, and you look at the front, say the answer, and check the back. One way to work by yourself with flashcards is to separate the cards into two piles after you know the answer, one pile for right guesses and another for wrong ones; after you go through the whole deck, you take a few from the right answers, shuffle them into the wrong answers, and repeat the process until the wrong pile is empty, by which time you presumably know all the right answers.

When you use a computer to present the questions you can use more complicated presentation strategies. For example, you can randomly throw in questions which you knew the answers for yesterday, or last week; the probability of seeing a question should be higher if your history with this question shows that you are still uncertain, but it should probably not be zero, even if you haven't made a mistake lately, because it makes sense to use your knowledge so you don't lose it.

In this computer game, we present a flashcard -- that is, a short question -- which moves across the screen. [I imagine the game being played in landscape mode, and maybe fixed in landscape.] When it reaches the end, the question is replaced by its answer. As the box holding the question moves across the screen, you can move it up and down. When it reaches the end of the screen, if it lands on a box containing the same answer, both disappear; otherwise the answer boxes pile up (reducing the time you have to steer the question) until the game becomes unplayable.

To make the question readable, I thought it would be good to magnify it as slides across the screeen, so that half-way across it might take up half the available screen. The center of the question box would move at constant speed as the box expands, and steering would move the center by a constant amount independent of the size of the box, but the expansion of the box might be limited by how close it came to the edge of the screen.

But in order to have more than one pile of questions at the end, the question box will have to shrink again to the height of one line of type as it reaches the end of its run. The width of the box, when it has become an answer, is determined by the length of the answer.

A menu should control how fast the questions move, and maybe which set of questions will be used.

Some sample flashcards

  1. arab.flsA couple of Arabic words and English equivalents
  2. arab.flssome easy math problems.
  3. mult.flsThe multiplication table

I wrote these in the format:

So no question will ever contain an equal sign, although an answer may.

For my particular set of flashcards, you could consider presenting either the question as the question, or the answer as the question.

Implementation hints

This time I'm not providing any actual code, so you aren't particularly bound by my bugs or suggestions.

But it makes sense to me to build a bitmap containing the question, and then use one of the drawBitmap() functions of Canvas to put it on the screen at various positions and sizes.

Once you get the animation parts of the game working, you can think about how you'd present the flashcards. It makes sense to me to read them into an array, and use a random number generator to choose which question to present, but maybe you want to present a question which has an answer visible for the player to aim at, to make the game part more interesting.

What you should turn in

  1. A journal, which describes which features you implemented and how well your game works.
  2. Copies of all of your source files
  3. Screenshots of the game working
  4. An .apk file of the game so that I can play it, if I can't resist after reading your description.

How to turn it in:

Package everthing into an archive file (.zip, .rar, or whatever) and attach it to an email to