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

5. Building a Text Game Engine > What You've Learned

What You've Learned

In this chapter, we put together a simple engine for a text adventure game. Along the way, you learned the following:

  • A game world can be represented by a mathematical graph, consisting of nodes for the places the player can visit and edges for the paths between these places.

  • You can store these nodes in an association list (alist) called *nodes*. This alist allows you to look up properties of a node/place by using its name. In the case of our game, the property we’re storing is a description of each node/place.

  • You use the assoc function to look up a key (location name in our example) in an alist.

  • Quasiquoting is a technique that allows you to insert small bits of computer code into larger pieces of data.

  • Some Lisp functions accept other functions as arguments. These are called higher-order functions. The mapcar function is the most popular higher-order function in Common Lisp.


  

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