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

19. Creating a Graphical, Web-Based Vers... > Playing Version 3 of Dice of Doom

Playing Version 3 of Dice of Doom

First, we need to start up our web server. Simply serve up our dod-request-handler, and we’re ready to go:

> (serve #'dod-request-handler)

Now move over to Firefox and go to http://localhost:8080/game.html. You should see our game in your browser:

image with no caption

When you click a tile, it is highlighted:

image with no caption

Now you can select a tile to attack. In this example, we’ll choose the stack of two dice to the right of the selected stack:

image with no caption

Next, let’s pass our turn by clicking the pass web link. This will cause the reinforcement dice to be placed (in this case, only a single additional die in the upper-left corner):

image with no caption

If you now hit continue, you will see the game cycle automatically through the moves for the computer player, in a similar fashion. It will keep going on like this until there is a winner for the game. You can always start a new game by just going back to the original game.html URL.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free Trial


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