Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

IV. Lisp is Science > 20. Making Dice of Doom More Fun

Chapter 20. Making Dice of Doom More Fun

It’s now time to create a final version of Dice of Doom. Version 4 of our game will be much more fun to play than our earlier versions.

Although you probably were not aware of it, we made some major compromises in the rules for our game to make it easier to program. In this chapter, we will allow more players, add rolling of the dice, and implement a few more changes to make Dice of Doom a much more interesting game.

Increasing the Number of Players

To begin, put all the code from the previous chapter in a file named dice_of_doom_v3.lisp (also available from the companion website), and then execute the following command:

> (load "dice_of_doom_v3.lisp")

The first change we’re going to make is to increase the number of players from two to four. Three of these will be AI opponents, played by the computer. Because of how we’ve written our code so far, this requires very little extra code:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint