Mercurial > coderloop
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:307a81e46071 |
---|---|
1 (ns coderloop.web-ship | |
2 (:use rlm.shell-inspect) | |
3 (:use [clojure.contrib.duck-streams :as ds :only []])) | |
4 | |
5 | |
6 ;;screw this ---- | |
7 | |
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)))) | |
15 | |
16 (comment -- this is the solution | |
17 | |
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 | |
26 | |
27 ) | |
28 | |
29 ;; translate into code | |
30 | |
31 | |
32 (def B "bsd") | |
33 (def L "linux") | |
34 (def W "windows") | |
35 | |
36 | |
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))) | |
47 | |
48 | |
49 | |
50 |