annotate 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
rev   line source
rlm@0 1 (ns coderloop.web-ship
rlm@0 2 (:use rlm.shell-inspect)
rlm@0 3 (:use [clojure.contrib.duck-streams :as ds :only []]))
rlm@0 4
rlm@0 5
rlm@0 6 ;;screw this ----
rlm@0 7
rlm@0 8 (defn sail
rlm@0 9 ([]
rlm@0 10 (ds/slurp*
rlm@0 11 (str "http://localhost:3000/ship/sail")))
rlm@0 12 ([host]
rlm@0 13 (ds/slurp*
rlm@0 14 (str "http://localhost:3000/ship/sail?host=" host))))
rlm@0 15
rlm@0 16 (comment -- this is the solution
rlm@0 17
rlm@0 18 WBL*| start
rlm@0 19 WB|L* move L
rlm@0 20 *WB|L sail back
rlm@0 21 B|*WL move W
rlm@0 22 LB*|W move L
rlm@0 23 L|*WB move B
rlm@0 24 *L|WB sail back
rlm@0 25 |*WBL move L
rlm@0 26
rlm@0 27 )
rlm@0 28
rlm@0 29 ;; translate into code
rlm@0 30
rlm@0 31
rlm@0 32 (def B "bsd")
rlm@0 33 (def L "linux")
rlm@0 34 (def W "windows")
rlm@0 35
rlm@0 36
rlm@0 37 (if (command-line?)
rlm@0 38 (do
rlm@0 39 (sail L)
rlm@0 40 (sail)
rlm@0 41 (sail W)
rlm@0 42 (sail L)
rlm@0 43 (sail B)
rlm@0 44 (sail)
rlm@0 45 (sail L)
rlm@0 46 (System/exit 0)))
rlm@0 47
rlm@0 48
rlm@0 49
rlm@0 50