Skip to content

Instantly share code, notes, and snippets.

@KingC100
Last active January 31, 2016 13:21
Show Gist options
  • Save KingC100/59201e36f075d627898a to your computer and use it in GitHub Desktop.
Save KingC100/59201e36f075d627898a to your computer and use it in GitHub Desktop.
make-city-edges
(defun make-city-edges ()
(let* ((nodes (loop for i from 1 to *node-num*
collect i))
(edge-list (connect-all-islands nodes(make-edge-list)))
(cops (remove-if-not (lambda (x) ;; xはremove-if-notへの引数として使用する。
(zerop (random *cop-odds*)))
edge-list)))
(add-cops (edges-to-alist edge-list) cops)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment