File tree Expand file tree Collapse file tree
src/swarm-lang/Swarm/Text/Markdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11This is a code
22block:
33
4- def opposite:
5-
6- Dir -> Dir
7- =
8- \d.
4+ def opposite:
5+ Dir -> Dir
6+ = \d.
97 if (d == left) {
108
119 right
1210 } {left}
1311end
1412
15- def x:
13+ def x:
1614 Int ->
1715 Cmd Unit ->
18- Cmd Unit
19- = \n.
20- \c.
16+ Cmd Unit
17+ = \n. \c.
2118 if (n == 0) {} {
2219
2320 c;
@@ -34,10 +31,8 @@ def goTrade =
3431 pure ()
3532end
3633
37- def fig8half:
38-
39- Dir -> Cmd Unit
40-
34+ def fig8half:
35+ Dir -> Cmd Unit
4136 = \d.
4237 x 3 (
4338 turn d;
@@ -46,9 +41,8 @@ def fig8half:
4641 goTrade
4742end
4843
49- def fig8:
50- Dir ->
51- Cmd Unit
44+ def fig8:
45+ Dir -> Cmd Unit
5246 = \d.
5347 turn back;
5448 fig8half (
@@ -67,7 +61,7 @@ def solution =
6761 x 5 (grab; m2);
6862 x 2 (
6963 turn
70- left;
64+ left;
7165 m2
7266 );
7367 m5;
Original file line number Diff line number Diff line change 11This is a code block:
22
3- def opposite: Dir -> Dir
4- =
5- \d.
3+ def opposite: Dir -> Dir
4+ = \d.
65 if (d == left) {right} {
76
87 left
98 }
109end
1110
12- def x:
11+ def x:
1312 Int -> Cmd Unit ->
14- Cmd Unit
13+ Cmd Unit
1514 = \n. \c.
1615 if (n == 0) {} {
1716 c;
@@ -27,16 +26,14 @@ def goTrade =
2726 pure ()
2827end
2928
30- def fig8half: Dir -> Cmd Unit
31-
29+ def fig8half: Dir -> Cmd Unit
3230 = \d.
3331 x 3 (turn d; goTrade);
3432 goTrade
3533end
3634
37- def fig8: Dir -> Cmd Unit
38- =
39- \d.
35+ def fig8: Dir -> Cmd Unit
36+ = \d.
4037 turn back;
4138 fig8half (opposite d);
4239 fig8half d;
Original file line number Diff line number Diff line change 11This is a code block:
22
3- def opposite: Dir -> Dir
3+ def opposite: Dir -> Dir
44 = \d.
55 if (d == left) {right} {left}
66end
77
8- def x: Int -> Cmd Unit -> Cmd Unit
9- =
10- \n. \c.
8+ def x: Int -> Cmd Unit -> Cmd Unit
9+ = \n. \c.
1110 if (n == 0) {} {c; x (n - 1) c}
1211end
1312
@@ -16,13 +15,13 @@ def m5 = x 5 move end
1615def goTrade = m5; drill down; pure ()
1716end
1817
19- def fig8half: Dir -> Cmd Unit
18+ def fig8half: Dir -> Cmd Unit
2019 = \d.
2120 x 3 (turn d; goTrade);
2221 goTrade
2322end
2423
25- def fig8: Dir -> Cmd Unit
24+ def fig8: Dir -> Cmd Unit
2625 = \d.
2726 turn back;
2827 fig8half (opposite d);
Original file line number Diff line number Diff line change 11This is a code block:
22
3- def opposite: Dir -> Dir
3+ def opposite: Dir -> Dir
44 = \d.
55 if (d == left) {right} {left}
66end
77
8- def x: Int -> Cmd Unit -> Cmd Unit
8+ def x: Int -> Cmd Unit -> Cmd Unit
99 = \n. \c.
1010 if (n == 0) {} {c; x (n - 1) c}
1111end
@@ -14,13 +14,13 @@ def m5 = x 5 move end
1414
1515def goTrade = m5; drill down; pure () end
1616
17- def fig8half: Dir -> Cmd Unit
17+ def fig8half: Dir -> Cmd Unit
1818 = \d.
1919 x 3 (turn d; goTrade);
2020 goTrade
2121end
2222
23- def fig8: Dir -> Cmd Unit
23+ def fig8: Dir -> Cmd Unit
2424 = \d.
2525 turn back;
2626 fig8half (opposite d);
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ This is a code block:
33def opposite: Dir -> Dir = \d. if (d == left) {right} {left}
44end
55
6- def x: Int -> Cmd Unit -> Cmd Unit
6+ def x: Int -> Cmd Unit -> Cmd Unit
77 = \n. \c.
88 if (n == 0) {} {c; x (n - 1) c}
99end
@@ -12,13 +12,13 @@ def m5 = x 5 move end
1212
1313def goTrade = m5; drill down; pure () end
1414
15- def fig8half: Dir -> Cmd Unit
15+ def fig8half: Dir -> Cmd Unit
1616 = \d.
1717 x 3 (turn d; goTrade);
1818 goTrade
1919end
2020
21- def fig8: Dir -> Cmd Unit
21+ def fig8: Dir -> Cmd Unit
2222 = \d.
2323 turn back;
2424 fig8half (opposite d);
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ This is a code block:
22
33def opposite: Dir -> Dir = \d. if (d == left) {right} {left} end
44
5- def x: Int -> Cmd Unit -> Cmd Unit
5+ def x: Int -> Cmd Unit -> Cmd Unit
66 = \n. \c.
77 if (n == 0) {} {c; x (n - 1) c}
88end
@@ -13,7 +13,7 @@ def goTrade = m5; drill down; pure () end
1313
1414def fig8half: Dir -> Cmd Unit = \d. x 3 (turn d; goTrade); goTrade end
1515
16- def fig8: Dir -> Cmd Unit
16+ def fig8: Dir -> Cmd Unit
1717 = \d.
1818 turn back;
1919 fig8half (opposite d);
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def goTrade = m5; drill down; pure () end
1010
1111def fig8half: Dir -> Cmd Unit = \d. x 3 (turn d; goTrade); goTrade end
1212
13- def fig8: Dir -> Cmd Unit
13+ def fig8: Dir -> Cmd Unit
1414 = \d.
1515 turn back;
1616 fig8half (opposite d);
Original file line number Diff line number Diff line change 11This is a Markdown file. It has some inline
2- code and a code block:
2+ code and a code block:
33
44def main: Cmd Unit =
55 move;
Original file line number Diff line number Diff line change 11This is a Markdown file. It has some inline
2- code and a code block:
2+ code and a code block:
33
44def main: Cmd Unit = move; move; place "rock"
55end
Original file line number Diff line number Diff line change @@ -5,20 +5,19 @@ n file.
55It has
66some
77inline
8- code
8+ code
99and a
1010code
1111block:
1212
1313def
14- main:
15-
14+ main:
1615 Cmd
17- Unit =
16+ Unit =
1817 move;
1918 move;
2019 place
21- "rock"
20+ "rock"
2221end
2322
2423Here is
You can’t perform that action at this time.
0 commit comments