<br><br><div class="gmail_quote">2010/8/4 Xie, WenSheng <span dir="ltr"><<a href="mailto:WenSheng.Xie@harman.com">WenSheng.Xie@harman.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">










<div link="blue" vlink="purple" lang="ZH-CN">

<div>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">Hi, Gustavo:</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">Great to hear that you are
thinking of working on this project later on.</span></font></p></div></div></blockquote><div><br>It became a matter of honor :) <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="ZH-CN"><div>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">It’s fun to practice
my lisp with this project.</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">What’s your plan to
make it a network/web-based multi-user game?</span></font></p></div></div></blockquote><div><br>Well, I actually didn't have this plan, but that is a nice idea. Back in 2008 my thoughts were to use the mailing list for communication and someone would run the program.<br>
<br>If the graphics part is created "modularly enough", it should be possible to change the backend - one backend would be the machine itself running the game and the other would be a wrapper around a web socket.<br>
<br>Security is complicated, thought. The file defining the feeb's brain would not be allowed to have any internal symbol from the package :the-feebs-war nor to create or use any packages, restricted to the exported symbols from :feebs and :cl, and perhaps :alexandria. Timeouts would be used to prevent users from creating infinite loops, but any user would still be able to exhaust the memory (or the stack), now I don't know how to prevent this.<br>
<br>I'll only set up a server if there are enough users interested in it, though, you are the first in 2 years.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="ZH-CN"><div>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">Further, I modify the graphics/graphics.lisp
slightly to make clearer display: (in red below)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">(in-package
:the-feebs-war)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> (defun
print-direction (dir)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">  (case dir</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">    </span></font><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">(0 #\N)</span></font></p>


<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">    (1 #\E)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">    (2 #\S)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">    (3
#\W)))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">(defun print-map ()</span></font></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="DE"> 
(format t "~%")  ;add this line</span></font></b></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">  </span></font><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">(dotimes (y *maze-y-size*)</span></font></p>


<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">   
(dotimes (x *maze-x-size*)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">     
(let ((elt (aref *maze* x y)))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">       
(apply 'format t</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">              
(cond</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
((wallp elt) </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                 
(list " XX"))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
((feeb-p (car elt))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                 
(list " F~a"</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                       
(print-direction (feeb-facing (car elt)))))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
((fireball-p (car elt))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                 
(list " *~a" (print-direction (fireball-direction (car elt)))))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
((eq (car elt) :mushroom)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                 
(list " mm"))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
((eq (car elt) :carcass)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                 
(list " cc"))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">                
</span></font><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">(t (list
"   "))))))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="DE">    (format
t "~%"))</span></font></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US"> 
(format t "~%")) ;add this line</span></font></b></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">(defun simple-play
(&optional layout)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">  (if layout</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">     
(change-layout layout))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">  (make-auto-feebs (-
10 (length *feebs-to-be*)))</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">  (initialize-feebs)</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">  (start-round)</span></font></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US"> 
(loop until (finish-game-p)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">    
do</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">      
(play-one-turn)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">  
    (print-map)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">      
(sleep 0.7))</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US"> 
(format t "Game Over!!~%~%Scores:~%~%")</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US"> 
(let ((scores nil))</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">   
(dolist (feeb *feebs*)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">     
(push (list (feeb-name feeb) (feeb-score feeb)) scores)) ;collect living feebs'
scores</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">   
(dolist (feeb *dead-feebs*)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">     
(push (list (feeb-name feeb) (feeb-score feeb)) scores)) ;collect dead feebs'
scores</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">   
(sort scores #'> :key
#'second)                              
;sort the scores in decreasing order</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">   
(dolist (score scores)</span></font></b></p>

<p class="MsoNormal"><b><font color="red" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: red; font-weight: bold;" lang="EN-US">     
(format t "~30@<~a:~> ~@d~%" (first score) (second
score)))))  ;print out scores</span></font></b></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">Please check if there are
helpful when you have time.</span></font></p></div></div></blockquote><div><br>I'll definitely change the repository to git. It is easier to create and apply patches, and I'm more used to it than to svn.<br></div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="ZH-CN"><div>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">Best regards,</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US">XIE Wensheng</span></font></p>

<p class="MsoNormal"><font color="navy" face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;" lang="EN-US">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
Gustavo [mailto:<a href="mailto:gugamilare@gmail.com" target="_blank">gugamilare@gmail.com</a>] <br>
<b><span style="font-weight: bold;">Sent:</span></b> Wednesday, August 04, 2010
8:55 AM<br>
<b><span style="font-weight: bold;">To:</span></b>
<a href="mailto:the-feebs-war-devel@common-lisp.net" target="_blank">the-feebs-war-devel@common-lisp.net</a><br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [the-feebs-war-devel]
document reviewed</span></font><span lang="EN-US"></span></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">Hello, XIE Wensheng,<br>
<br>
I'm sorry for not approving your post, but it's been so much time that I've
lost the admin password.<br>
<br>
As you can see, the project is a little dead :S<br>
<br>
I might work on it again at the end of this year or beginning of the next one,
but no promises.</span></font><span lang="EN-US"></span></p>

<div link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">The
document file has been reviewed and some spelling errors are corrected.</span></font><span lang="EN-US"></span></p>

</div>

</div>

<div>

<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US"><br>
</span></font><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">Thank you for reviewing the .tex file, I'll take a look at
it and commit later, and sorry for the spell mistakes.</span></font><span lang="EN-US"> </span></p>

</div>

<blockquote style="border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;">


<div link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"> </span></font><span lang="EN-US"></span></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">One
question:</span></font><span lang="EN-US"></span></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"> </span></font><span lang="EN-US"></span></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">Why
the parameter ‘fireball-guaranteed-lifetime is not used in the program?</span></font><span lang="EN-US"></span></p>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US">How
to use it?</span></font><span lang="EN-US"></span></p>

</div>

</div>

</blockquote>

<p class="MsoNormal"><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"><br>
It's a bug, I missed it, thanks for reporting. Now it is (hopefully) fixed and
committed (fortunately I remember the svn password :)</span></font><span lang="EN-US"><br>
</span><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"><br>
In case you wonder, these are the changes: in systems.lisp, create a slot named
lifetime:<br>
<br>
</span></font><font face="Courier New" size="1"><span style="font-size: 9pt; font-family: "Courier New";" lang="EN-US">(defclass object ()<br>
  ((direction  :accessor object-direction  :initarg :direction)<br>
   (x-position :accessor object-x-position :initarg :x-position)<br>
   (y-position :accessor object-y-position :initarg :y-position)<br>
   (lifetime   :accessor object-lifetime  
:initarg :lifetime :initform 0)))</span></font><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"><br>
<br>
<br>
add a method for make-move:<br>
<br>
</span></font><font face="Courier New" size="1"><span style="font-size: 9pt; font-family: "Courier New";" lang="EN-US">(defmethod make-move :after
(object move)<br>
  (incf (object-lifetime object)))</span></font><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"><br>
<br>
<br>
and, in definitions/rules.lisp, make these changes:<br>
<br>
</span></font><font face="Courier New" size="1"><span style="font-size: 9pt; font-family: "Courier New";" lang="EN-US">(def-feeb-parm
'fireball-guaranteed-lifetime 3<br>
  "Number of turns that a fireball is guaranteed not to dissipate,<br>
unless it encounters a wall.")<br>
<br>
(defmethod make-move-choice ((fireball fireball))<br>
  (cond<br>
   ((wallp (get-forward-pos fireball))<br>
    (if (chance (get-feeb-parm
'fireball-reflection-probability))<br>
        :turn-around<br>
        :dissipate))<br>
   ((and (>= (object-lifetime fireball)<br>
            
(get-feeb-parm 'fireball-guaranteed-lifetime))<br>
         (chance (get-feeb-parm
'fireball-dissipation-probability)))<br>
    :dissipate)<br>
   (t :move-forward)))</span></font><font face="Arial" size="1"><span style="font-size: 9pt; font-family: Arial;" lang="EN-US"><br>
<br>
<br>
Regards,<br>
Gustavo.</span></font><span lang="EN-US"> </span></p>

</div></div></div>

</div>


<br>_______________________________________________<br>
the-feebs-war-devel mailing list<br>
<a href="mailto:the-feebs-war-devel@common-lisp.net">the-feebs-war-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/the-feebs-war-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/the-feebs-war-devel</a><br>
<br></blockquote></div><br>