drakongen 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.vscode/launch.json +18 -0
  2. package/LICENSE +24 -0
  3. package/README.md +80 -0
  4. package/browser/drakongen.js +1303 -0
  5. package/browsertest.html +84 -0
  6. package/buildbrowser +4 -0
  7. package/buildexamples.js +61 -0
  8. package/examples/00.Empty.drakon +1 -0
  9. package/examples/00.Empty.txt +5 -0
  10. package/examples/01. /320/221/320/265/320/273/321/213/320/270/314/206.drakon" +13 -0
  11. package/examples/01. /320/221/320/265/320/273/321/213/320/271.json" +16 -0
  12. package/examples/01. /320/221/320/265/320/273/321/213/320/271.txt" +4 -0
  13. package/examples/02. /320/247/320/265/314/210/321/200/320/275/321/213/320/270/314/206.drakon" +28 -0
  14. package/examples/02. /320/247/321/221/321/200/320/275/321/213/320/271.json" +31 -0
  15. package/examples/02. /320/247/321/221/321/200/320/275/321/213/320/271.txt" +10 -0
  16. package/examples/03. /320/241/320/265/321/200/321/213/320/270/314/206.drakon" +20 -0
  17. package/examples/03. /320/241/320/265/321/200/321/213/320/271.json" +23 -0
  18. package/examples/03. /320/241/320/265/321/200/321/213/320/271.txt" +6 -0
  19. package/examples/04. /320/221/321/203/321/200/321/213/320/270/314/206.drakon" +25 -0
  20. package/examples/04. /320/221/321/203/321/200/321/213/320/271.json" +29 -0
  21. package/examples/04. /320/221/321/203/321/200/321/213/320/271.txt" +7 -0
  22. package/examples/05. /320/226/320/265/314/210/320/273/321/202/321/213/320/270/314/206.drakon" +25 -0
  23. package/examples/05. /320/226/321/221/320/273/321/202/321/213/320/271.json" +29 -0
  24. package/examples/05. /320/226/321/221/320/273/321/202/321/213/320/271.txt" +7 -0
  25. package/examples/06. /320/221/320/260/320/263/321/200/320/276/320/262/321/213/320/270/314/206.drakon" +30 -0
  26. package/examples/06. /320/221/320/260/320/263/321/200/320/276/320/262/321/213/320/271.json" +35 -0
  27. package/examples/06. /320/221/320/260/320/263/321/200/320/276/320/262/321/213/320/271.txt" +10 -0
  28. package/examples/07. /320/244/320/270/320/276/320/273/320/265/321/202/320/276/320/262/321/213/320/270/314/206.drakon" +42 -0
  29. package/examples/07. /320/244/320/270/320/276/320/273/320/265/321/202/320/276/320/262/321/213/320/271.json" +49 -0
  30. package/examples/07. /320/244/320/270/320/276/320/273/320/265/321/202/320/276/320/262/321/213/320/271.txt" +14 -0
  31. package/examples/08. /320/221/320/270/321/200/321/216/320/267/320/276/320/262/321/213/320/270/314/206.drakon" +27 -0
  32. package/examples/08. /320/221/320/270/321/200/321/216/320/267/320/276/320/262/321/213/320/271.json" +27 -0
  33. package/examples/08. /320/221/320/270/321/200/321/216/320/267/320/276/320/262/321/213/320/271.txt" +6 -0
  34. package/examples/09. /320/236/321/200/320/260/320/275/320/266/320/265/320/262/321/213/320/270/314/206.drakon" +37 -0
  35. package/examples/09. /320/236/321/200/320/260/320/275/320/266/320/265/320/262/321/213/320/271.json" +39 -0
  36. package/examples/09. /320/236/321/200/320/260/320/275/320/266/320/265/320/262/321/213/320/271.txt" +10 -0
  37. package/examples/10. /320/240/320/276/320/267/320/276/320/262/321/213/320/270/314/206.drakon" +42 -0
  38. package/examples/10. /320/240/320/276/320/267/320/276/320/262/321/213/320/271.json" +54 -0
  39. package/examples/10. /320/240/320/276/320/267/320/276/320/262/321/213/320/271.txt" +16 -0
  40. package/examples/11. /320/227/320/260/321/211/320/270/321/202/320/275/321/213/320/270/314/206.drakon" +37 -0
  41. package/examples/11. /320/227/320/260/321/211/320/270/321/202/320/275/321/213/320/271.json" +39 -0
  42. package/examples/11. /320/227/320/260/321/211/320/270/321/202/320/275/321/213/320/271.txt" +10 -0
  43. package/examples/12. /320/221/320/276/320/273/320/276/321/202/320/275/321/213/320/270/314/206.drakon" +44 -0
  44. package/examples/12. /320/221/320/276/320/273/320/276/321/202/320/275/321/213/320/271.json" +43 -0
  45. package/examples/12. /320/221/320/276/320/273/320/276/321/202/320/275/321/213/320/271.txt" +10 -0
  46. package/examples/13. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/270/314/206.drakon" +54 -0
  47. package/examples/13. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.json" +63 -0
  48. package/examples/13. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.txt" +18 -0
  49. package/examples/14. /320/227/320/276/320/273/320/276/321/202/320/276/320/270/314/206.drakon" +64 -0
  50. package/examples/14. /320/227/320/276/320/273/320/276/321/202/320/276/320/271.json" +73 -0
  51. package/examples/14. /320/227/320/276/320/273/320/276/321/202/320/276/320/271.txt" +22 -0
  52. package/examples/15. /320/241/320/270/320/275/320/270/320/270/314/206.drakon" +54 -0
  53. package/examples/15. /320/241/320/270/320/275/320/270/320/271.json" +87 -0
  54. package/examples/15. /320/241/320/270/320/275/320/270/320/271.txt" +26 -0
  55. package/examples/16. /320/223/320/276/320/273/321/203/320/261/320/276/320/270/314/206.drakon" +37 -0
  56. package/examples/16. /320/223/320/276/320/273/321/203/320/261/320/276/320/271.json" +48 -0
  57. package/examples/16. /320/223/320/276/320/273/321/203/320/261/320/276/320/271.txt" +13 -0
  58. package/examples/17. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/270/314/206.drakon" +39 -0
  59. package/examples/17. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.json" +41 -0
  60. package/examples/17. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.txt" +10 -0
  61. package/examples/18. /320/241/321/202/320/260/320/273/321/214/320/275/320/276/320/270/314/206.drakon" +49 -0
  62. package/examples/18. /320/241/321/202/320/260/320/273/321/214/320/275/320/276/320/271.json" +67 -0
  63. package/examples/18. /320/241/321/202/320/260/320/273/321/214/320/275/320/276/320/271.txt" +19 -0
  64. package/examples/19. Lilla.drakon +39 -0
  65. package/examples/19. Lilla.json +45 -0
  66. package/examples/19. Lilla.txt +11 -0
  67. package/examples/Adaptive design.drakon +116 -0
  68. package/examples/Adaptive design.json +153 -0
  69. package/examples/Adaptive design.txt +47 -0
  70. package/examples/And test.drakon +46 -0
  71. package/examples/And test.json +46 -0
  72. package/examples/And test.txt +10 -0
  73. package/examples/Arrow - double exit.drakon +41 -0
  74. package/examples/Arrow - double exit.json +62 -0
  75. package/examples/Arrow - double exit.txt +14 -0
  76. package/examples/Complex arrow.drakon +93 -0
  77. package/examples/Complex arrow.json +162 -0
  78. package/examples/Complex arrow.txt +43 -0
  79. package/examples/DoubleArrow.drakon +53 -0
  80. package/examples/DoubleArrow.json +86 -0
  81. package/examples/DoubleArrow.txt +18 -0
  82. package/examples/Find pointing nodes.drakon +104 -0
  83. package/examples/Find pointing nodes.json +137 -0
  84. package/examples/Find pointing nodes.txt +29 -0
  85. package/examples/How to tune PID on a quadcopter.drakon +488 -0
  86. package/examples/How to tune PID on a quadcopter.json +734 -0
  87. package/examples/How to tune PID on a quadcopter.txt +169 -0
  88. package/examples/Or test.drakon +47 -0
  89. package/examples/Or test.json +46 -0
  90. package/examples/Or test.txt +10 -0
  91. package/examples/Silhouette test 1.drakon +47 -0
  92. package/examples/Silhouette test 1.json +82 -0
  93. package/examples/Silhouette test 1.txt +24 -0
  94. package/examples/Work out action-check.drakon +30 -0
  95. package/examples/Work out action-check.json +45 -0
  96. package/examples/Work out action-check.txt +9 -0
  97. package/examples/Workout foreach.drakon +63 -0
  98. package/examples/Workout foreach.json +62 -0
  99. package/examples/Workout foreach.txt +14 -0
  100. package/examples/ar01.drakon +25 -0
  101. package/examples/ar01.json +40 -0
  102. package/examples/ar01.txt +7 -0
  103. package/examples/ar02.drakon +30 -0
  104. package/examples/ar02.json +45 -0
  105. package/examples/ar02.txt +10 -0
  106. package/examples/ar03.drakon +32 -0
  107. package/examples/ar03.json +44 -0
  108. package/examples/ar03.txt +7 -0
  109. package/examples/ar04.drakon +37 -0
  110. package/examples/ar04.json +49 -0
  111. package/examples/ar04.txt +10 -0
  112. package/examples/ar05.drakon +37 -0
  113. package/examples/ar05.json +59 -0
  114. package/examples/ar05.txt +11 -0
  115. package/examples/ar06.drakon +40 -0
  116. package/examples/ar06.json +70 -0
  117. package/examples/ar06.txt +13 -0
  118. package/examples/ar07.drakon +40 -0
  119. package/examples/ar07.json +70 -0
  120. package/examples/ar07.txt +13 -0
  121. package/examples/ar08.drakon +47 -0
  122. package/examples/ar08.json +81 -0
  123. package/examples/ar08.txt +16 -0
  124. package/examples/ar09.drakon +52 -0
  125. package/examples/ar09.json +87 -0
  126. package/examples/ar09.txt +17 -0
  127. package/examples/ar10.drakon +52 -0
  128. package/examples/ar10.json +88 -0
  129. package/examples/ar10.txt +18 -0
  130. package/examples/ar11.drakon +47 -0
  131. package/examples/ar11.json +82 -0
  132. package/examples/ar11.txt +17 -0
  133. package/examples/ar12.drakon +37 -0
  134. package/examples/ar12.json +49 -0
  135. package/examples/ar12.txt +10 -0
  136. package/examples/getToken.drakon +76 -0
  137. package/examples/getToken.json +88 -0
  138. package/examples/getToken.txt +41 -0
  139. package/examples/tmp.drakon +49 -0
  140. package/examples/tmp.json +82 -0
  141. package/examples/tmp.txt +37 -0
  142. package/package.json +21 -0
  143. package/prompts/drakonToPrompt.txt +139 -0
  144. package/prompts/index.txt +17 -0
  145. package/prompts/printPseudo.txt +116 -0
  146. package/src/browserTools.js +39 -0
  147. package/src/drakonToPromptStruct.js +44 -0
  148. package/src/drakonToStruct.js +416 -0
  149. package/src/drakongen.js +16 -0
  150. package/src/index.js +17 -0
  151. package/src/main.js +157 -0
  152. package/src/nodeTools.js +38 -0
  153. package/src/printPseudo.js +167 -0
  154. package/src/structFlow.js +382 -0
  155. package/src/technicalTree.js +84 -0
  156. package/src/tools.js +36 -0
  157. package/src/translate.js +108 -0
@@ -0,0 +1,169 @@
1
+ By Oscar Liang
2
+
3
+ Procedure "How to tune PID on a quadcopter"
4
+
5
+ Algorithm:
6
+ Call subroutine: "Prepare"
7
+
8
+ Subroutine: "Prepare"
9
+ Listen
10
+ To the motor sound
11
+
12
+ Backup your current PID values
13
+
14
+ Switch to Rate Mode (aka Acro Mode)
15
+
16
+ Make sure your quadcopter’s CG (centre of gravity) is right in the middle
17
+
18
+ Call subroutine "Set initial values"
19
+ End of subroutine
20
+
21
+ Subroutine: "Set initial values"
22
+ Set RC rates, super rates and expo
23
+
24
+ Set default PID values
25
+
26
+ Lower all the values by at least half
27
+
28
+ Call subroutine "P on Roll"
29
+ End of subroutine
30
+
31
+ Subroutine: "P on Roll"
32
+ Loop forever
33
+ Cruise around
34
+
35
+ Do some sharp turns
36
+
37
+ If not (Does the quad dip to one side (like a wobble)?) and not (Do slow oscillations occur?)
38
+ If Do fast oscilations occur?
39
+ Decrease P on Roll
40
+
41
+ Else
42
+ break
43
+ Else
44
+ Increase P on Roll
45
+
46
+ Call subroutine "P on Pitch"
47
+ End of subroutine
48
+
49
+ Subroutine: "P on Pitch"
50
+ Loop forever
51
+ Do a split-S (where you move both the throttle and pitch sticks)
52
+
53
+ Increase throttle to recover, pay attention to the pitch movement
54
+
55
+ If Does the quad pitch up more than it should?
56
+ Increase P on Pitch
57
+
58
+ Else
59
+ If not (Do fast oscilations occur?) and not (Are the motors making a twitching sound?)
60
+ break
61
+ Else
62
+ Decrease P on Pitch
63
+
64
+ Call subroutine "TPA"
65
+ End of subroutine
66
+
67
+ Subroutine: "TPA"
68
+ Loop forever
69
+ Do a punch out
70
+
71
+ If Does the quad get oscillations with high throttle?
72
+ Increase TPA
73
+
74
+ Else
75
+ break
76
+ Call subroutine "D on Roll and Pitch"
77
+ End of subroutine
78
+
79
+ Subroutine: "D on Roll and Pitch"
80
+ Loop forever
81
+ Do aggressive maneuvers like flips and rolls
82
+
83
+ If not (Does the quad overshoot at the end of the move then bounce back?) and not (Does prop wash happen? (oscillation when you descent))
84
+ If Do fast oscillation happen at the end of a roll or flip?
85
+ Decrease D on the affected axis
86
+
87
+ Else
88
+ break
89
+ Else
90
+ Increase D on the affected axis
91
+
92
+ Call subroutine "I on Roll"
93
+ End of subroutine
94
+
95
+ Subroutine: "I on Roll"
96
+ Loop forever
97
+ Bank your quad to the left and right
98
+
99
+ Release stick
100
+
101
+ If Is the quad holding the angle well?
102
+ If not (Does the quad have stiff, robotic feeling?) and not (Does the quad have oscilations?)
103
+ break
104
+ Else
105
+ Decrease I on Roll
106
+
107
+ Else
108
+ Increase I on Roll
109
+
110
+ Call subroutine "I on Pitch"
111
+ End of subroutine
112
+
113
+ Subroutine: "I on Pitch"
114
+ Loop forever
115
+ Fly forward, do not increase throttle
116
+
117
+ If Does the nose keep the same angle?
118
+ break
119
+ Else
120
+ Increase I on Pitch
121
+
122
+ Call subroutine "Anti Gravity Gain"
123
+ End of subroutine
124
+
125
+ Subroutine: "Anti Gravity Gain"
126
+ Loop forever
127
+ Fly in a straight line
128
+
129
+ Do some rapid punchouts
130
+
131
+ If Does pitch stay at the same angle?
132
+ break
133
+ Else
134
+ Increase Anti Gravity
135
+
136
+ Call subroutine "P on Yaw"
137
+ End of subroutine
138
+
139
+ Subroutine: "P on Yaw"
140
+ Loop forever
141
+ Spin quickly on the yaw axis
142
+
143
+ Stop spinning
144
+
145
+ If Does the quad dip one side?
146
+ Increase P on Yaw
147
+
148
+ Else
149
+ If Do you get fast oscilations?
150
+ Decrease P on Yaw
151
+
152
+ Else
153
+ break
154
+ Call subroutine "I on Yaw"
155
+ End of subroutine
156
+
157
+ Subroutine: "I on Yaw"
158
+ Loop forever
159
+ Fly straight
160
+
161
+ Make a turn
162
+
163
+ If Is there drift, does the quad slide out?
164
+ Increase I on Yaw
165
+
166
+ Else
167
+ break
168
+ End of subroutine
169
+ End of procedure
@@ -0,0 +1,47 @@
1
+ {
2
+ "items": {
3
+ "1": {
4
+ "type": "end"
5
+ },
6
+ "2": {
7
+ "type": "branch",
8
+ "branchId": 0,
9
+ "one": "3"
10
+ },
11
+ "3": {
12
+ "type": "question",
13
+ "content": "<p>One</p>",
14
+ "one": "6",
15
+ "two": "8",
16
+ "flag1": 1
17
+ },
18
+ "6": {
19
+ "type": "action",
20
+ "content": "<p>Do it!</p>",
21
+ "one": "1",
22
+ "two": ""
23
+ },
24
+ "8": {
25
+ "type": "question",
26
+ "content": "<p>Two</p>",
27
+ "one": "6",
28
+ "two": "9",
29
+ "flag1": 0
30
+ },
31
+ "9": {
32
+ "type": "question",
33
+ "content": "<p>Three</p>",
34
+ "one": "6",
35
+ "two": "10",
36
+ "flag1": 1
37
+ },
38
+ "10": {
39
+ "type": "action",
40
+ "content": "<p>Do not do it</p>",
41
+ "one": "1",
42
+ "two": ""
43
+ }
44
+ },
45
+ "type": "drakon",
46
+ "id": "Or test.drakon"
47
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "Or test",
3
+ "params": "",
4
+ "branches": [
5
+ {
6
+ "branchId": 0,
7
+ "start": "3",
8
+ "body": [
9
+ {
10
+ "type": "question",
11
+ "id": "3",
12
+ "content": {
13
+ "operator": "or",
14
+ "left": {
15
+ "operator": "or",
16
+ "left": "<p>One</p>",
17
+ "right": {
18
+ "operator": "not",
19
+ "operand": "<p>Two</p>"
20
+ }
21
+ },
22
+ "right": "<p>Three</p>"
23
+ },
24
+ "yes": [
25
+ {
26
+ "id": "6",
27
+ "type": "action",
28
+ "content": "<p>Do it!</p>"
29
+ }
30
+ ],
31
+ "no": [
32
+ {
33
+ "id": "10",
34
+ "type": "action",
35
+ "content": "<p>Do not do it</p>"
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "id": "1",
41
+ "type": "end"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,10 @@
1
+ Procedure "Or test"
2
+
3
+ Algorithm:
4
+ If (One or not (Two)) or Three
5
+ Do it!
6
+
7
+ Else
8
+ Do not do it
9
+
10
+ End of procedure
@@ -0,0 +1,47 @@
1
+ {
2
+ "items": {
3
+ "1": {
4
+ "type": "end"
5
+ },
6
+ "2": {
7
+ "type": "branch",
8
+ "branchId": 1,
9
+ "one": "5",
10
+ "content": "Branch1"
11
+ },
12
+ "3": {
13
+ "type": "branch",
14
+ "content": "Exit",
15
+ "one": "1",
16
+ "branchId": 3
17
+ },
18
+ "4": {
19
+ "type": "branch",
20
+ "content": "Branch2",
21
+ "one": "6",
22
+ "branchId": 2
23
+ },
24
+ "5": {
25
+ "type": "question",
26
+ "content": "<p>AAAAAAA</p>",
27
+ "one": "4",
28
+ "two": "3",
29
+ "flag1": 1
30
+ },
31
+ "6": {
32
+ "type": "question",
33
+ "content": "<p>BBBB</p>",
34
+ "one": "7",
35
+ "two": "3",
36
+ "flag1": 1
37
+ },
38
+ "7": {
39
+ "type": "action",
40
+ "content": "<p>CCCC</p>",
41
+ "one": "3"
42
+ }
43
+ },
44
+ "type": "drakon",
45
+ "id": "Silhouette test 1.drakon",
46
+ "style": "{\"maxWidth\":160}"
47
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "Silhouette test 1",
3
+ "params": "",
4
+ "branches": [
5
+ {
6
+ "name": "Branch1",
7
+ "branchId": 1,
8
+ "start": "5",
9
+ "body": [
10
+ {
11
+ "type": "question",
12
+ "id": "5",
13
+ "content": "<p>AAAAAAA</p>",
14
+ "yes": [
15
+ {
16
+ "id": "ad-1000",
17
+ "type": "address",
18
+ "content": "Branch2"
19
+ }
20
+ ],
21
+ "no": [
22
+ {
23
+ "id": "ad-1001",
24
+ "type": "address",
25
+ "content": "Exit"
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "id": "2-end",
31
+ "type": "end"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "name": "Branch2",
37
+ "branchId": 2,
38
+ "start": "6",
39
+ "body": [
40
+ {
41
+ "type": "question",
42
+ "id": "6",
43
+ "content": "<p>BBBB</p>",
44
+ "yes": [
45
+ {
46
+ "id": "7",
47
+ "type": "action",
48
+ "content": "<p>CCCC</p>"
49
+ },
50
+ {
51
+ "id": "ad-1002",
52
+ "type": "address",
53
+ "content": "Exit"
54
+ }
55
+ ],
56
+ "no": [
57
+ {
58
+ "id": "ad-1002",
59
+ "type": "address",
60
+ "content": "Exit"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "id": "4-end",
66
+ "type": "end"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "name": "Exit",
72
+ "branchId": 3,
73
+ "start": "1",
74
+ "body": [
75
+ {
76
+ "id": "1",
77
+ "type": "end"
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ }
@@ -0,0 +1,24 @@
1
+ Procedure "Silhouette test 1"
2
+
3
+ Algorithm:
4
+ Call subroutine: "Branch1"
5
+
6
+ Subroutine: "Branch1"
7
+ If AAAAAAA
8
+ Call subroutine "Branch2"
9
+ Else
10
+ Call subroutine "Exit"
11
+ End of subroutine
12
+
13
+ Subroutine: "Branch2"
14
+ If BBBB
15
+ CCCC
16
+
17
+ Call subroutine "Exit"
18
+ Else
19
+ Call subroutine "Exit"
20
+ End of subroutine
21
+
22
+ Subroutine: "Exit"
23
+ End of subroutine
24
+ End of procedure
@@ -0,0 +1,30 @@
1
+ {
2
+ "items": {
3
+ "1": {
4
+ "type": "end"
5
+ },
6
+ "2": {
7
+ "type": "branch",
8
+ "branchId": 0,
9
+ "one": "5"
10
+ },
11
+ "3": {
12
+ "type": "action",
13
+ "content": "<p>Lift weight</p>",
14
+ "one": "4"
15
+ },
16
+ "4": {
17
+ "type": "question",
18
+ "content": "<p>Tired?</p>",
19
+ "one": "1",
20
+ "two": "5",
21
+ "flag1": 1
22
+ },
23
+ "5": {
24
+ "type": "arrow-loop",
25
+ "one": "3"
26
+ }
27
+ },
28
+ "type": "drakon",
29
+ "id": "Work out action-check.drakon"
30
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "Work out action-check",
3
+ "params": "",
4
+ "branches": [
5
+ {
6
+ "branchId": 0,
7
+ "start": "5",
8
+ "body": [
9
+ {
10
+ "id": "5",
11
+ "type": "loop",
12
+ "content": "",
13
+ "body": [
14
+ {
15
+ "id": "3",
16
+ "type": "action",
17
+ "content": "<p>Lift weight</p>"
18
+ },
19
+ {
20
+ "type": "question",
21
+ "id": "4",
22
+ "content": "<p>Tired?</p>",
23
+ "yes": [
24
+ {
25
+ "type": "break"
26
+ }
27
+ ],
28
+ "no": [
29
+ {
30
+ "id": "arrow-stub-5",
31
+ "type": "loopend",
32
+ "start": "5"
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ "id": "1",
40
+ "type": "end"
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,9 @@
1
+ Procedure "Work out action-check"
2
+
3
+ Algorithm:
4
+ Loop forever
5
+ Lift weight
6
+
7
+ If Tired?
8
+ break
9
+ End of procedure
@@ -0,0 +1,63 @@
1
+ {
2
+ "items": {
3
+ "2": {
4
+ "type": "end"
5
+ },
6
+ "4": {
7
+ "type": "action",
8
+ "one": "59",
9
+ "content": "Warm up"
10
+ },
11
+ "56": {
12
+ "type": "branch",
13
+ "branchId": 0,
14
+ "one": "4"
15
+ },
16
+ "58": {
17
+ "type": "loopend",
18
+ "one": "2"
19
+ },
20
+ "59": {
21
+ "type": "loopbegin",
22
+ "one": "60",
23
+ "content": "<p>For each exercize in the program</p>"
24
+ },
25
+ "60": {
26
+ "type": "loopbegin",
27
+ "one": "62",
28
+ "content": "Repeat 10 times",
29
+ "two": ""
30
+ },
31
+ "61": {
32
+ "type": "loopend",
33
+ "one": "58",
34
+ "content": "",
35
+ "two": ""
36
+ },
37
+ "62": {
38
+ "type": "action",
39
+ "one": "63",
40
+ "content": "Lift the weight",
41
+ "two": ""
42
+ },
43
+ "63": {
44
+ "type": "question",
45
+ "flag1": 0,
46
+ "one": "61",
47
+ "two": "64",
48
+ "content": "Tired?"
49
+ },
50
+ "64": {
51
+ "type": "action",
52
+ "content": "<p>Say: huff da</p>",
53
+ "one": "58",
54
+ "two": ""
55
+ },
56
+ "header": {
57
+ "type": "header",
58
+ "style": "{\"font\":\"bold 16px Arimo\"}"
59
+ }
60
+ },
61
+ "type": "drakon",
62
+ "id": "Workout foreach.drakon"
63
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "Workout foreach",
3
+ "params": "",
4
+ "branches": [
5
+ {
6
+ "branchId": 0,
7
+ "start": "4",
8
+ "body": [
9
+ {
10
+ "id": "4",
11
+ "type": "action",
12
+ "content": "Warm up"
13
+ },
14
+ {
15
+ "id": "59",
16
+ "type": "loop",
17
+ "content": "<p>For each exercize in the program</p>",
18
+ "body": [
19
+ {
20
+ "id": "60",
21
+ "type": "loop",
22
+ "content": "Repeat 10 times",
23
+ "body": [
24
+ {
25
+ "id": "62",
26
+ "type": "action",
27
+ "content": "Lift the weight"
28
+ },
29
+ {
30
+ "type": "question",
31
+ "id": "63",
32
+ "content": "Tired?",
33
+ "yes": [
34
+ {
35
+ "id": "64",
36
+ "type": "action",
37
+ "content": "<p>Say: huff da</p>"
38
+ },
39
+ {
40
+ "type": "break"
41
+ }
42
+ ],
43
+ "no": [
44
+ {
45
+ "id": "61",
46
+ "type": "loopend",
47
+ "start": "60"
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "id": "2",
57
+ "type": "end"
58
+ }
59
+ ]
60
+ }
61
+ ]
62
+ }
@@ -0,0 +1,14 @@
1
+ Procedure "Workout foreach"
2
+
3
+ Algorithm:
4
+ Warm up
5
+
6
+ For each exercize in the program
7
+ Repeat 10 times
8
+ Lift the weight
9
+
10
+ If Tired?
11
+ Say: huff da
12
+
13
+ break
14
+ End of procedure
@@ -0,0 +1,25 @@
1
+ {
2
+ "type": "drakon",
3
+ "items": {
4
+ "2": {
5
+ "type": "end"
6
+ },
7
+ "4": {
8
+ "type": "question",
9
+ "flag1": 1,
10
+ "one": "2",
11
+ "two": "17",
12
+ "content": "3"
13
+ },
14
+ "17": {
15
+ "type": "arrow-loop",
16
+ "one": "4",
17
+ "content": ""
18
+ },
19
+ "21": {
20
+ "type": "branch",
21
+ "branchId": 0,
22
+ "one": "17"
23
+ }
24
+ }
25
+ }