You are previewing Land of Lisp.

Land of Lisp

Cover of Land of Lisp by Conrad Barski M.D. Published by No Starch Press
O'Reilly logo

Drawing a Map of Our City

We’re finally ready to draw a map of our new city. We’re using a standard format for our graph data, so writing this function is a breeze:

(defun draw-city ()
  (ugraph->png "city" *congestion-city-nodes* *congestion-city-edges*))

We created the ugraph->png function in the previous chapter, as part of our graph library.

Now call (new-game) from the REPL, and open the picture in your web browser:

image with no caption


Since every city map created by our code is unique, your map will look completely different from the one in this picture.

Finally, we can marvel at the results of our urban planning!

Drawing a City from Partial Knowledge ...

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