Cover by Conrad Barski M.D.

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

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 city.dot.png picture in your web browser:

image with no caption

Note

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required