The Code Samples
I have hesitated to put up any code samples at all. In a very real way, I feel that having them here is counter to the spirit of Toy Problems, which wants to encourage the reader to think, do, and try him- or herself, rather than just watching a pre-packaged solution.
So, why am I putting them up at all? Mostly to show that interesting problems do not require long programs. Also, I hope that they provide a starting point for those readers who have less programming experience. Finally, a few readers may want to consult a working solution to pick up a useful little technique here and there.
This being said, I would like to add that all code samples are examples only. They are not production ready in any way, and I make no claims to their correctness. I also make no claims to the quality of the code, although I have made an effort to document and comment the code so that it is accessible to others.
All parts of this website are:
Copyright (C) 2006 Philipp K. Janert (Seattle, Washington, USA).
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.