You are previewing Land of Lisp.

Land of Lisp

Cover of Land of Lisp by Conrad Barski M.D. Published by No Starch Press
O'Reilly logo

Dice of Doom, Version 2

In Chapter 15, we created the first version of our Dice of Doom game. We are now going to modify some of the functions from that version. To proceed, place the code from that chapter into a file named dice_of_doom_v1.lisp so that we can reference it in this new version (or just download that file from

To use our previous Dice of Doom and our new lazy list library, run the following in the REPL:

> (load "dice_of_doom_v1.lisp")
> (load "lazy.lisp")

Next, we’re going to increase the size of our board to a more roomy 4-by-4:

> (defparameter *board-size* 4)
> (defparameter *board-hexnum* (* *board-size* *board-size*))

To allow the game to run at a reasonable speed at this larger size, we’ll make the list ...

The best content for your career. Discover unlimited learning on demand for around $1/day.