Changes between Version 43 and Version 44 of Clojure Client Tutorial


Ignore:
Timestamp:
Aug 8, 2011 12:57:21 PM (13 years ago)
Author:
kedwar10
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Clojure Client Tutorial

    v43 v44  
    5858== Client Usage Tutorial ==
    5959
    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 
    6460Now 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.
    6561
     
    8884
    8985{{{
    90 client.core=> (run-ioquake "/full/path/to/ioquake3.i386" "firstroom")
     86client.core=> (run-ioquake "/full/path/to/ioquake3.i386" "sat")
    9187#<UNIXProcess java.lang.UNIXProcess@2a5ab9>
    9288}}}
     
    147143* :move-for "mf"
    148144* :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
     151client.core=> (scan-area3 :Bob 8000)                                                                                                                                                     
     152:watcher303
     153I found player at (611.700012 90.081947 0.000000)
     154I found player at (32.000000 -90.000000 0.000000)
     155I found info_player_deathmatch at (32.000244 -90.000000 0.223811)
     156I found quagent_item_treasure at (572.168640 20.462269 0.901278)
     157I found quagent_item_gold at (375.085327 56.309933 1.374918)
     158I found quagent_item_gold at (1019.278626 42.455196 0.505915)
     159I found quagent_item_treasure at (697.711304 63.434952 0.739097)
     160I found quagent_item_gold at (905.141357 8.130102 0.569713)
     161I found info_player_deathmatch at (0.125000 0.000000 90.000000)
    150162* :jump-once "ju"
    151163* :rotate "ro"