From 71b828dbb30f471cb45bf528be2d62f2a8bc8724 Mon Sep 17 00:00:00 2001 From: Grant Shangreaux Date: Mon, 31 Jan 2022 21:40:29 -0600 Subject: Docs: note about broken code samples --- mafia.org | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mafia.org b/mafia.org index 1c6051e..48ca53e 100644 --- a/mafia.org +++ b/mafia.org @@ -323,7 +323,8 @@ If they're being watched, simply have them target a random other actor (?) #+begin_src emacs-lisp (defun mafia-random-other (actor other-actors) (with-slots (id) actor - (let ((other-ids (cl-remove-if (lambda (i) (= i id)) (mapcar 'mafia-actor-id other-actors)))) + (let ((other-ids (cl-remove-if (lambda (i) (= i id)) + (mapcar 'mafia-actor-id other-actors)))) (cdr (object-assoc (seq-random-elt other-ids) :id other-actors))))) #+end_src @@ -337,13 +338,16 @@ If they're being watched, simply have them target a random other actor (?) #+end_src #+RESULTS: -: #s(mafia-killer 15 #s(mafia-innocent 5 #s(mafia-innocent 12 #1 nil alive 5) nil alive 7) nil) +: #s(mafia-innocent 5 #s(mafia-innocent 9 #s(mafia-innocent 10 #s(mafia-innocent 2 #s(mafia-innocent 13 #s(mafia-innocent 12 #s(mafia-innocent 7 #4 alive nil 1) alive nil 6) alive nil 4) alive nil 7) alive nil 3) alive nil 10) alive nil 9) -*** Example Three Actor Play +*** TODO Example Three Actor Play :PROPERTIES: :header-args: :noweb-ref example-three-way-setup :END: +*NOTE* code example here is currently "broken" due to random behavior in newer +code + Imagining "optimal" play if there are only 3 actors. The game begins and each actor chooses a target. If the killer makes eye contact with anyone, they'll wink, no matter if they're being observed or not, since they win @@ -384,16 +388,11 @@ Then change target and observe again: ~C-c C-c~ on the following block will run this code: -#+begin_src emacs-lisp :noweb yes :noweb-ref none :tangle no :results output +#+begin_src emacs-lisp :noweb yes :noweb-ref none :tangle no <> + (with-current-buffer "*MAFIA-LOG*" (buffer-string)) #+end_src -#+RESULTS: -: -: "the killer abides" -: -: "the killer winks" - Add in a 4th actor, and then its trickier. The killer would like to wink when they are sure they aren't being watched and then immediately try for eye contact with another actor. The other actors may want to maintain -- cgit v1.2.3