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