This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Cracker Barrel Game Solution

2 posts · 4642 views

Hi Everyone,

I am very new to Scheme and I am trying to tackle the Cracker Barrel Pegboard Game. I found a website that has some example code, but I cant seem to get it to work. When I try to run it, I get an "Unbound variable: null" error.

The files I am running are located here:
http://www.computingbook.org/list-procedures.ss
http://www.computingbook.org/pegboard.ss

You need both files to run it.

The instructions on how to use it are here: http://www.computingbook.org/ch5-data.pdf, but I can't get it to run. I keep getting the above error.

I am evaluating (solve-pegboard (board- remove-peg (make-board 5) (make-position 1 1)))


Any help would be greatly appreciated. I have been pounding my head all day, trying to figure this out. Or if you know of any confirmed working code, that would be great too.

Thanks in advance!

Re: Cracker Barrel Game Solution

The author appears to be using some slightly non-standard symbols, but nothing that is not easily corrected.

Try defining the following equivalents before running the code:
(define null nil)
(define true #t)
(define false #f)