Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
public:t-622-arti-11-1:lab_1_materials [2011/01/13 12:35] – angelo | public:t-622-arti-11-1:lab_1_materials [2024/04/29 13:33] (current) – external edit 127.0.0.1 |
---|
'(: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) |