You are previewing Land of Lisp.

Land of Lisp

Cover of Land of Lisp by Conrad Barski M.D. Published by No Starch Press

Implementing Dice of Doom, Version 1

Let’s start coding this game in Lisp. As we discussed in the previous chapter, this game will contain both clean, functional code and dirty, imperative code. You’ll be able to tell in which category a block of code fits by the “clean/functional” or “dirty/imperative” icon next to it.

Defining Some Global Variables

First, we’ll create some global variables that define the basic parameters for our game:

 (defparameter *num-players* 2)
 (defparameter *max-dice* 3)
 (defparameter *board-size* 2)
 (defparameter *board-hexnum* ...

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