diff src/web_ship.clj @ 0:307a81e46071 tip

initial committ
author Robert McIntyre <rlm@mit.edu>
date Tue, 18 Oct 2011 01:17:49 -0700
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/web_ship.clj	Tue Oct 18 01:17:49 2011 -0700
     1.3 @@ -0,0 +1,50 @@
     1.4 +(ns coderloop.web-ship
     1.5 +  (:use rlm.shell-inspect)
     1.6 +  (:use [clojure.contrib.duck-streams :as ds :only []]))
     1.7 +
     1.8 +
     1.9 +;;screw this ---- 
    1.10 +
    1.11 +(defn sail
    1.12 +  ([]
    1.13 +     (ds/slurp*
    1.14 +      (str "http://localhost:3000/ship/sail")))
    1.15 +  ([host]
    1.16 +     (ds/slurp*
    1.17 +      (str "http://localhost:3000/ship/sail?host=" host))))
    1.18 +
    1.19 +(comment -- this is the solution
    1.20 +
    1.21 +  WBL*|  start
    1.22 +  WB|L*  move L
    1.23 +  *WB|L  sail back
    1.24 +  B|*WL  move W
    1.25 +  LB*|W  move L
    1.26 +  L|*WB  move B
    1.27 +  *L|WB  sail back
    1.28 +  |*WBL  move L
    1.29 +
    1.30 +  )
    1.31 +
    1.32 +;; translate into code
    1.33 +
    1.34 +
    1.35 +(def B "bsd")
    1.36 +(def L "linux")
    1.37 +(def W "windows")
    1.38 +
    1.39 +
    1.40 +(if (command-line?)
    1.41 +  (do
    1.42 +    (sail L)
    1.43 +    (sail)
    1.44 +    (sail W)
    1.45 +    (sail L)
    1.46 +    (sail B)
    1.47 +    (sail)
    1.48 +    (sail L)
    1.49 +    (System/exit 0)))
    1.50 +    
    1.51 +	
    1.52 +
    1.53 +