Changes between Version 43 and Version 44 of Clojure Client Tutorial
- Timestamp:
- Aug 8, 2011 12:57:21 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Clojure Client Tutorial
v43 v44 58 58 == Client Usage Tutorial == 59 59 60 '''Note: The order of the scheduling and op arguments to client->server has been reversed. Also, the initial data structure passed to the send functions can now be specified by the user.'''61 62 '''New Note: client->server function has been removed; just call send functions with same args.'''63 64 60 Now it is time to learn to use the client. cd to the top level directory and typu "lein repl". If everything went smoothly you'll see something about no rlwrap and the prompt. 65 61 … … 88 84 89 85 {{{ 90 client.core=> (run-ioquake "/full/path/to/ioquake3.i386" " firstroom")86 client.core=> (run-ioquake "/full/path/to/ioquake3.i386" "sat") 91 87 #<UNIXProcess java.lang.UNIXProcess@2a5ab9> 92 88 }}} … … 147 143 * :move-for "mf" 148 144 * :move-by "mb" 149 * :move-to "mt" 145 * :move-to "mt"client.core=> (defn scan-area3 [quagent radius] 146 (send-and-watch quagent :radar :now [radius] 147 nil 148 (fn [prev data] (rest data)) 149 (fn [k r o n] (println "I found" (first n) "at" (rest n))))) 150 #'client.core/scan-area3 151 client.core=> (scan-area3 :Bob 8000) 152 :watcher303 153 I found player at (611.700012 90.081947 0.000000) 154 I found player at (32.000000 -90.000000 0.000000) 155 I found info_player_deathmatch at (32.000244 -90.000000 0.223811) 156 I found quagent_item_treasure at (572.168640 20.462269 0.901278) 157 I found quagent_item_gold at (375.085327 56.309933 1.374918) 158 I found quagent_item_gold at (1019.278626 42.455196 0.505915) 159 I found quagent_item_treasure at (697.711304 63.434952 0.739097) 160 I found quagent_item_gold at (905.141357 8.130102 0.569713) 161 I found info_player_deathmatch at (0.125000 0.000000 90.000000) 150 162 * :jump-once "ju" 151 163 * :rotate "ro"