One container.
Ten items.
One restriction.

The Knapsack Problem
The Game of Premature Optimization

by Leonard Richardson
Released 6 May 2001

Current release: 3 (14 August 2001)
Download: Z-Code file Inform and Python source code

About The Knapsack Problem

The Knapsack Problem is the simplest of a series of games I plan to write, all involving, well, the knapsack problem. I think that there is a wealth of fun to be had with the knapsack problem, and that it's just a matter of finding the right game framework for it (much as Tetris provides a fun framework for the bin packing problem). The Knapsack Problem is the control game for my future experiments, as it were.

The Knapsack Problem was written for LoTechComp, a competition for Choose Your Own Adventure-type games. The Knapsack Problem is nowhere close to being a Choose Your Own Adventure-type game, but it follows all the rules, so they had to accept it. They did not, however, have to give me a prize (nor should they have).

If you like this game, see my IF page for information on my other games, which you may or may not like.

About Release 3

Adam Cadre's review complains of a problem whereby the game claimed he didn't get the optimal solution, even though he did. This bug, caused by a very stupid mistake on my part, is fixed in release 3. Who will find the next bug?


Cedric Knight sent in a bunch of item fragments and found a bunch of problems and suggested fixes for them. Adam Cadre and Pete Peterson found a bug apiece.

This document (source) is part of Crummy, the webspace of Leonard Richardson (contact information). It was last modified on Tuesday, April 13 2004, 04:17:26 Nowhere Standard Time and last built on Saturday, April 01 2023, 16:00:01 Nowhere Standard Time.

Crummy is © 1996-2023 Leonard Richardson. Unless otherwise noted, all text licensed under a Creative Commons License.

Document tree:
Site Search: