Download libredo-0.9.tar.gz
Github site

Branching Undo and Redo

libredo is a simple library that makes it easy to add powerful undo and redo commands to a logic puzzle game (or similar type of program). Many such programs that provide undo and redo commands will remember undone states only while a user is using these two commands. Once the user uses some other command that changes state in a new way, all of the undone states are forgotten. This limited functionality is common, if not ubiquitous. I would like to see more programs offer something better: that is what this library is provided for.

libredo makes it easy for a program to manage a complete history of user actions. The program can then allow the user to navigate around this history, to notify them when they move into already-explored territory, and to automatically detect when existing sub-sequences have been improved upon.

libredo comes with complete documentation of its API, which you can read here:

API documentation.

In addition, the distribution includes a sample program that demonstrates all of the major features of the library as part of a simple (curses-based) sokoban program.

You can also see a demonstration of libredo in my implementation of Brain Jam. This solitaire game uses libredo to track a full history for every game. This capability encourages the player to improve their solutions by searching for new solutions with fewer moves.

At this time, libredo is distributed under version 2 of the GNU General Public License. Questions, bug reports, and feedback in general all should be directed to <breadbox@muppetlabs.com>.

If you use this library in your own projects, let me know. Alternately, if you wanted to use this library in your own project but can't for some reason, also let me know. I'm looking for other perspectives on how this functionality can be provided.


Software
Brian Raiter