Cracker Barrel Game Solution

Discussion of Scheme and Racket
Post Reply
Posts: 1
Joined: Mon Apr 25, 2011 2:12 am

Cracker Barrel Game Solution

Post by TempestDragon » Mon Apr 25, 2011 2:23 am

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:

You need both files to run it.

The instructions on how to use it are here:, 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!

Posts: 45
Joined: Tue Dec 14, 2010 1:39 am

Re: Cracker Barrel Game Solution

Post by saulgoode » Mon Apr 25, 2011 12:24 pm

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:

Code: Select all

(define null nil)
(define true #t)
(define false #f)

Post Reply