[plt-scheme] ATTN: Neil Van Dyke (and some philosophical musings on debuggers)

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Sep 16 06:57:55 EDT 2004

On Sep 15, 2004, at 11:14 PM, Robby Findler wrote:

> What about a functional program that has to model a Parcheesi game?
> Parcheesi has a ring around the board, which I represented as a vector,
> using modular arithmetic (I never bang into the vector, except to
> initialize it).
>
> Also in Parcheesi, there are exit "ramps" that come out of the ring at
> different places (one place for each player). During the game, each
> player enters the ring just after the exit, makes a nearly complete
> cycle and then moves off, into the exit ramp. It's illegal to pass
> certain spaces on the board, depending on what's on that space and it's
> illegal to go too far (off the end of the exit ramp -- it's possible to
> attempt to move from the main ring off the end of the exit ramp, based
> on the numbers you could legally move an individual piece in one turn).
>
> Writing a function that detects illegal moves requires keeping all of
> that straight, and getting it working right is far easier if you can
> see what the values of variables as the program runs on some of the
> weireder situations. Sure, I used printf, but I consider printf a
> debugger, in this case. What I really needed was the ability to see
> what's happening in my program as it executes. Isn't that what a
> debugger does? (Lord knows, _I'm_ the one that actually removed the
> bugs!)
>
> Robby
>
> [ My corner has little Jack Horner and I've just stolen his pie ]

I don't see how this functional part can work without an accumulator.
So I definitely think you may need a debugger -- of the kind you added
to DrScheme (View | Show Tracing) for me.

-- Matthias



Posted on the users mailing list.