O'Reilly logo

Land of Lisp by Conrad Barski M.D.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 http://landoflisp.com/).

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required