[plt-scheme] another game: pacman

From: Jon Rafkind (workmin at ccs.neu.edu)
Date: Thu Aug 17 18:54:33 EDT 2006

Noel Welsh wrote:
> Nice!  It worked out of the box for me, which is incredible
> (load of stuff doesn't work on my Linux box).  Game play
> was smooth, except for a few random pauses which I assume
> were caused by GC.
> I've had to write many similar programs for my PhD work,
> and I quite like the communicating sequential processes
> (CSP) style for this sort of system.  In the CSP style you
> have a bunch of threads that communicate via channels.  For
> Pacman you'd have a game world thread, threads for each
> ghost, and a thread for the player.  The game world thread
> is the boss and tells the other threads when to stop and
> start, and when to perform particular actions.  The other
> threads response to commands from the game world thread. 
> Each thread is a tail recursive loop. I find this style
> much easier to program reactive systems in than OO style. 
> There is much less explicit state, and you get your main
> loop back.  [This is basically the Erlang style, and also
> very similar to FRP]
That sounds interesting and I think I understand it but can you provide
a small example so I can analyze it more deeply?

I looked into Erlang once but didn't like the syntax. Dumb reason for
not liking a language I know :p

Posted on the users mailing list.