REBOL Flash Cards
Fall 2011, David Matuszek

Purposes of this assignment

General idea

Write a "flash cards" program.

I've programmed a quick mockup of the GUI, in order to give you the general idea. Your program does not (should not) look exactly like this.

flash cards GUI

This GUI has a place to display the "question" and an initially blank place to display the "answer." The user sees the question, tries to remember the answer, then clicks the "Show answer" button (or otherwise indicates to the program that it should show the correct answer).

The idea of the remaining buttons is this: If the user could not remember the correct answer, it should be asked again "soon" (say, after 5 or 10 more questions). If the user says "hard," it should be asked again after perhaps 20 or 30 questions; if "good", after 75 or 100; and if "easy" it should be a long time before the user sees it again


Here's how to accomplish this. Have a circular list of question/answer pairs. If the user clicks "soon," move the pair to about five locations ahead in the list; if "hard", 20 locations; if "good", 75 locations ahead; and if "easy", just leave it in place (the list is circular, so this is the "furthest" location"). Of course, if there are fewer items in the list than the number of locations you want to move an item (for example, if there are 70 items in the list and you want to move ahead 75), you don't want to "lap" your position and put the item 5 ahead. (This scheme really works best for a large number of flash cards, like 1000.)

Not shown in the above image: Your program needs to load a file of question/answer pairs; it needs to allow the user to quit the program; and when the user quits, it needs to save the current list back into the original file (so that the next time the user loads that file, the program resumes in the exact same place). Try not to clutter up the interface too much with this added functionality. Unfortunately, REBOL doesn't supply a built-in menu bar widget (but you can find one if you look for it).

The input and output files should consist of one question/answer pair per line, separated by a pipe ("|") character; for instance,
der Bleistift | the pencil

I haven't specified everything about the program, so don't bother me about all the details. I think I've specified everything necessary for us to run your program and test it out. I will try to come up with a good data set, but you should build your own. (German isn't a good choice, because of the umlauts.)


All the usual: Correctness and style.

Correctness has to do with whether you followed the assignment instructions (which are pretty general) and whether the program crashes.

Style is all about how readable you have made the program, and whether you've made it unnecessarily complicated for what it does. As in any language, things should have meaningful names, layout should help display the structure of the program, and small, single-purpose functions are better than long complicated ones.

Due date

Monday, October 2, before 6am. Zip and turn in to Blackboard a file containing your .r program and your data file.