User Tools

Site Tools


public:t-622-arti-11-1:lab_1_materials

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:t-622-arti-11-1:lab_1_materials [2011/01/12 11:21] angelopublic:t-622-arti-11-1:lab_1_materials [2024/04/29 13:33] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
   * Material:   * Material:
 +    * [[http://www-formal.stanford.edu/jmc/history/lisp/lisp.html|The history of Lisp]] written by its author John McCarthy (interesting read)
     * Lisp Tutorial: [[http://cs.gmu.edu/~sean/lisp/LispTutorial.html|Part I]], [[http://cs.gmu.edu/~sean/lisp/LispTutorial2.html|Part II]] and [[http://cs.gmu.edu/~sean/lisp/LispTutorial3.html|Part III]].     * Lisp Tutorial: [[http://cs.gmu.edu/~sean/lisp/LispTutorial.html|Part I]], [[http://cs.gmu.edu/~sean/lisp/LispTutorial2.html|Part II]] and [[http://cs.gmu.edu/~sean/lisp/LispTutorial3.html|Part III]].
     * Lisp cheat sheet: ([[http://www.apl.jhu.edu/~hall/Lisp-Notes/Introductory-Lisp-Overview.ps|PS Format]]) or ({{:public:t-622-arti-09-1:introductory-lisp-overview.pdf|PDF Format}}).     * Lisp cheat sheet: ([[http://www.apl.jhu.edu/~hall/Lisp-Notes/Introductory-Lisp-Overview.ps|PS Format]]) or ({{:public:t-622-arti-09-1:introductory-lisp-overview.pdf|PDF Format}}).
Line 8: Line 9:
      * A freely available book on Lisp: [[http://gigamonkeys.com/book/|Practical Common Lisp]].      * A freely available book on Lisp: [[http://gigamonkeys.com/book/|Practical Common Lisp]].
   * IDE and Lisp Implementations:   * IDE and Lisp Implementations:
-    * [[http://common-lisp.net/project/lispbox/|Lispbox]], an Emacs + SLIME + Common Lisp easy to install package: ([[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-sbcl-1.0.38.tar.gz|Linux 32-bit]], [[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-x64-sbcl-1.0.38.tar.gz|Linux 64-bit]]), ([[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-ccl-1.5-windowsx86.zip|Win32]]) or ([[http://common-lisp.net/project/lispbox/test_builds/Lispbox-0.7-with-ccl-1.5-darwinx86.dmg|MAC OS X]]).+    * Lispbox 0.7 (Stable Release), an Emacs + SLIME + Common Lisp easy to install package ([[http://www.ru.is/faculty/hannes/share/lispbox07.exe|Win32]]) or ([[http://www.ru.is/faculty/hannes/share/Lispbox-0.7-with-acl81_express.dmg|MAC OS X]]). 
 +      * [[http://common-lisp.net/project/lispbox/|Lispbox]] (Latest Unstable Beta Version): ([[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-sbcl-1.0.38.tar.gz|Linux 32-bit]], [[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-x64-sbcl-1.0.38.tar.gz|Linux 64-bit]]), ([[http://common-lisp.net/project/lispbox/test_builds/lispbox-0.7-ccl-1.5-windowsx86.zip|Win32]]) or ([[http://common-lisp.net/project/lispbox/test_builds/Lispbox-0.7-with-ccl-1.5-darwinx86.dmg|MAC OS X]]).
     * Eclipse Lisp Plugin (Win32, MAC OS X and Linux): [[http://sourceforge.net/projects/dandelion-ecl/|Dandelion]].     * Eclipse Lisp Plugin (Win32, MAC OS X and Linux): [[http://sourceforge.net/projects/dandelion-ecl/|Dandelion]].
     * Emacs reference card: ([[http://refcards.com/docs/wingb/xemacs/xemacs-refcard-a4.pdf|PDF Format]]).     * Emacs reference card: ([[http://refcards.com/docs/wingb/xemacs/xemacs-refcard-a4.pdf|PDF Format]]).
Line 14: Line 16:
 To work through these exercises, refer to the above material for more information. To work through these exercises, refer to the above material for more information.
  
-  - **Emacs and REPL:**\\ Install [[http://common-lisp.net/project/lispbox/|LispBox]] on your computer and start it up. The upper window is the Lisp REPL (read-eval-print loop) where you can enter Lisp expressions and have them evaluated.+  - **Emacs and REPL:**\\ Install [[http://common-lisp.net/project/lispbox/|LispBox]] on your computer and start it up. The lower window is the Lisp REPL (read-eval-print loop) where you can enter Lisp expressions and have them evaluated.
   - **Hello World:**\\ Type an expression that prints "Hello World!" on the screen. \\ <code lisp>   - **Hello World:**\\ Type an expression that prints "Hello World!" on the screen. \\ <code lisp>
 ;; HINT: A typical print expression ;; HINT: A typical print expression
Line 62: Line 64:
 '(:x 0 :y 0 :dirty T) '(:x 0 :y 0 :dirty T)
 </code> Here, **'':x''** and **'':y''** are the location of the agent and **'':dirty''** tells us if the current square has dirt or not. \\  </code> Here, **'':x''** and **'':y''** are the location of the agent and **'':dirty''** tells us if the current square has dirt or not. \\ 
-    - Write a new agent program called **''random-agent-program''**, that has two options: Walk around the environment randomly or remain idle when it finds a clean square; Suck up dirt when it finds it. \\ Your agent program should return one of the symbols **''LEFT''**, **''RIGHT''**, **''UP''**, **''DOWN''**, **''SUCK''** or **''IDLE''**.  You can either write your function directly in the REPL or add it to the file. If you add it to the file, you have to save the file (keyboard shortcut is Ctrl+X, Ctrl+S in emacs) and then reload the file in the REPL (recommended option). Instead of typing the load command again, you can reload the file by hitting Ctrl+C, Ctrl+L while the file window is active.\\ <code lisp>+    - Write a new agent program called **''random-agent-program''**, that has two options: Walk around the environment randomly or remain idle when it finds a clean square; Suck up dirt when it finds it. \\ Your agent program should return one of the symbols **''LEFT''**, **''RIGHT''**, **''UP''**, **''DOWN''**, **''SUCK''** or **''IDLE''**.  You can either write your function directly in the REPL or add it to the file. If you add it to the file, you have to save the file (keyboard shortcut is Ctrl+X, Ctrl+S in emacs) and then reload the file in the REPL (recommended option).\\ <code lisp>
 ;; HINT: Getting a random value. ;; HINT: Getting a random value.
 ;; This function returns a random nonnegative number less than number, and of the same type (either integer or floating-point) ;; This function returns a random nonnegative number less than number, and of the same type (either integer or floating-point)
Line 94: Line 96:
 ;; for the elements in the sequence.  ;; for the elements in the sequence. 
 ;; Counting the number of clean squares (in agents.lisp) ;; Counting the number of clean squares (in agents.lisp)
-;; Notethe not function as the following syntax (not x) and returns T if x is NIL, otherwise returns NIL+;; Notethe not function has the following syntax (not x) and returns T if x is NIL, otherwise returns NIL
 (count-if #'not (env-dirt-vector env))) (count-if #'not (env-dirt-vector env)))
 </code> How does this change the evaluation score? Can you think of ways to change the agent program so that it scores better with this new evaluation function? </code> How does this change the evaluation score? Can you think of ways to change the agent program so that it scores better with this new evaluation function?
/var/www/cadia.ru.is/wiki/data/attic/public/t-622-arti-11-1/lab_1_materials.1294831299.txt.gz · Last modified: 2024/04/29 13:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki