-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.html
246 lines (244 loc) · 10.7 KB
/
main.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Logo Interpreter</title>
<meta name="author" content="@justyy">
<script src="js/jquery-3.3.1.min.js"></script>
<script src="lang/en-us.js"></script>
<script src="lang/zh-cn.js"></script>
<script src="lang/zh-tw.js"></script>
<script src="js/logo_constants.js"></script>
<script src="js/queue.js"></script>
<script src="js/logo_funs.js"></script>
<script src="js/logocanvas.js"></script>
<script src="js/logoparser.js"></script>
<script src="js/functions.js"></script>
<script src="js/logo.js"></script>
<link href="bs/css/bootstrap.min.css" rel="stylesheet" />
<script src="bs/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/jquery-ui.css" />
<script src="js/jquery-ui.js"></script>
<script src="js/translate.js"></script>
<link rel="stylesheet" href="css/main.css" />
</head>
<body>
<div id="tabs" class='ext-window'>
<ul>
<li><a id="text_canvas" href="#tabs-canvas">Canvas</a></li>
<li><a id="text_setting" href="#tabs-setting">Setting</a></li>
<li><a id="text_help" href="#tabs-help">Help</a></li>
<li><a id="text_log" href="#tabs-log">Log</a></li>
</ul>
<div id="tabs-canvas">
<img id=turtle src="images/turtle.png" />
<canvas id="logo" class='canvas' width=500 height=480 style='border: 1px dashed'>
</canvas>
<span style='float:right'>
<textarea class='form-control'wrap='off' placeholder='e.g. FD 10 RT 90' id='console' style='width:240px; height: 465px' rows=6></textarea>
<span style='float:right'>
<span style='cursor:pointer' id="run">[Ctrl + Enter]</span> -
<a id='download' style='cursor:pointer' target=_blank>[↓]</a> -
<a id='csbutton' style='cursor:pointer'>[CS]</a>
</span>
</span>
</div>
<div id="tabs-setting">
<h4 id="text_ui_language">UI Language</h4>
<select class="form-control" id="lang">
<option value="en-us">English</option>
<option value="zh-cn">简体中文</option>
<option value="zh-tw">繁體中文</option>
</select>
<h4 id="text_procedures">Global Procedures</h4>
<textarea class='form-control' placeholder='e.g. TO PROC FD 10 RT 90 END' id='procedures' style='width: 100%' rows=15></textarea>
<button class="form-control" style='width: 70px' id="setting_save_btn">Save</button>
</div>
<div id="tabs-help">
<h4 id='text_logs'>Logs</h4>
<p><a href="https://helloacm.com/out/buymecoffee" target="_blank"><img src="images/lato-blue.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a></p>
<ul>
<li>v0.0.17: Add CS Button</li>
<li>v0.0.16: Bug Fixes</li>
<li><a target=_blank href="https://helloacm.com/the-goto-keyword-in-logo-turtle-programming/">v0.0.15: The GOTO Keyword in LOGO Turtle Programming</a></li>
<li><a target=_blank href="https://helloacm.com/logoturtle-v0-0-14-add-status-bar-add-repcount-and-bug-fixes/">v0.0.14: Add Status Bar, Add Repcount and Bug Fixes</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-13-support-rgb-add-shortcodes-global-procedures-editor/">v0.0.13: Turtle Programming v0.0.13: Support RGB, Add ShortCodes, Global Procedures Editor</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-12-powerful-for-loop-inc-dec-and-on-npm/">v0.0.12: Turtle Programming v0.0.12: Powerful For Loop, INC, DEC, and on NPM!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-while-loop-do-else-loop-and-unit-tests-added/">v0.0.11: Turtle Programming: While Loop, Do/Else Loop and Unit Tests Added</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-fractal-stars-random-console-eraser-setpc-setxy-examples-wait-bug-fixes-and-so-much-more/">v0.0.10: Turtle Programming: Fractal Stars, Random, Console, Eraser, SetPC, SetXY, Examples, Wait, Bug Fixes and So much more!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-9-add-setx-sety-square-and-rect/">v0.0.9: Turtle Programming v0.0.9: Add SetX, SetY, Square and Rect!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-8-comments-dotxy-and-javascript/">v0.0.8: Turtle Programming v0.0.8: /* */ comments, dotxy, and javascript!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-7-functions-with-parameters-recursion/">v0.0.7: Turtle Programming v0.0.7: Functions with Parameters + Recursion!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-6-adding-circle-moveto-turn-and-screen/">v0.0.6: Turtle Programming: Adding Circle, MoveTo, Turn and Screen!</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-programming-v0-0-5-adding-if-else-and-stop/">v0.0.5: Turtle Programming v0.0.5: Adding IF/ELSE and STOP!</a></li>
<li><a target=_blank href="https://helloacm.com/logoturtle-make-variables-and-comments/">v0.0.4: LogoTurtle: Make Variables and Comments</a></li>
<li><a target=_blank href="https://helloacm.com/turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png/">v0.0.3: Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png</a></li>
<li><a target=_blank href="https://helloacm.com/logoturtle-v0-0-2-showturtle-hideturtle-color-width-and-help/">v0.0.2: LogoTurtle v0.0.2: ShowTurtle, HideTurtle, Color, Width and Help.</a></li>
<li><a target=_blank href="https://helloacm.com/teach-your-kids-programming-the-first-logo-interpreter-turtle-graphics-in-chrome-extension/">v0.0.1: Teach Your Kids Programming - The First Logo Interpreter (Turtle Graphics) in Chrome Extension!</a></li>
</ul>
<h4 id='examples'>Examples</h4>
<ul>
<li><div id='chess_board'>Chess Board</div>
<pre>
TO FK :B
HT # hide the turtle
IF :B>15 [STOP]
REPEAT 4 [FD :B RT 90]
FK :B+1 # draw a bigger square to fill
END
TO QP :Y
IF :Y>4 [STOP]
REPEAT 4 [FK 15 FD 15 FK 1 FD 15]
RT 90 FD 30 RT 90
REPEAT 4 [FK 15 FD 15 FK 1 FD 15]
RT 180
QP :Y+1
END
QP 1
</pre>
</li>
<li><div id='frac_star'>Fractal Stars</div>
<pre>
cs ht
to star :size :small
if :size<:small [stop]
repeat 5 [fd :size star :size*0.3 :small rt 144]
end
star 200 10
</pre>
</li>
<li>
<pre>
ht cs for [i 0 360 45] [seth :i make "n 0
repeat 80 [setpc :random*15
repeat 8 [fd :n rt 45] make "n :n+1
]
]
</pre>
</li>
<li><pre>
to randomwalk
repeat 100 [
make "r parseInt(:random*3)
if :r==0 [fd 20]
if :r==1 [rt 90 fd 20]
if :r==2 [lt 90 fd 20]
]
end
</pre>
</li>
<li>
<pre>
to spiral
make "n 1
while :n<100 [
make "n :n+5
fd :n rt 90
]
end
</pre>
</li>
<li><pre>
repeat 18[repeat 4[repeat 18[fd 10 rt 5] rt 180]rt 20]
repeat 18[repeat 18[repeat 4[repeat 18[fd 10 rt 5] rt 160]rt 20] rt 20]
repeat 4[repeat 9[repeat 4[repeat 9[fd 25 rt 10] repeat 9[ fd 25 lt 10] rt 160] lt 40] rt 90]
</pre></li>
<li><pre>
repeat 100 [fd :repcount*3 rt 90]
</pre></li>
<li><pre>
repeat 36[repeat 36[fd 10 pu fd 10 pd rt 10]lt 10]
</pre></li>
<li><pre>
repeat 72[repeat 4[repeat 4[fd 10 pu fd 20 pd fd 10] rt 90]lt 5]
</pre></li>
<li><pre>
rt 10
goto @start
repeat [5 fd 100 rt 144]
@start
make "i 0
@hello
fd 100
rt 90
make "i :i+1
if :i<4 [goto @hello]
fd 100
</pre></li>
</ul>
<h4 id='supported_commands'>Support Commands</h4>
<ul>
<li>FD, FORWARD, WALK</li>
<li>BK, BACKWARD</li>
<li>RT, RIGHT</li>
<li>LT, LEFT</li>
<li>ST, SHOWTURTLE</li>
<li>HT, HIDETURTLE</li>
<li>COLOR</li>
<li>WIDTH</li>
<li>PU, PENUP</li>
<li>PD, PENDOWN</li>
<li>HOME</li>
<li>CS, CLEARSCREEN</li>
<li>REPEAT</li>
<li>FONTSIZE</li>
<li>TEXT, LABEL</li>
<li>DOT</li>
<li>JMP, JUMP</li>
<li>MAKE</li>
<li>IF/ELSE</li>
<li>STOP</li>
<li>TURN, SETH</li>
<li>CIRCLE</li>
<li>SCREEN, SETSC, SETSCREENCOLOR</li>
<li>SETXY, MOVETO</li>
<li>TO, END</li>
<li>DOTXY</li>
<li>JS</li>
<li>RECT</li>
<li>SQUARE</li>
<li>SETX</li>
<li>SETY</li>
<li>PENERASE, PE</li>
<li>PENPAINT, PPT</li>
<li>WAIT</li>
<li>PC, SETPC, SETCOLOR, SETPENCOLOR</li>
<li>PRINT, CONSOLE</li>
<li>WHILE</li>
<li>DO/ELSE</li>
<li>FOR</li>
<li>INC</li>
<li>DEC</li>
<li>CLEAR</li>
<li>REMOVE</li>
<li>CLEARCONSOLE</li>
<li>GOTO</li>
</ul>
<h4 id="global_vars">Global Variables</h4>
<ul>
<li>:random</li>
<li>:repcount</li>
<li>:turtlex</li>
<li>:turtley</li>
<li>:turtleangle</li>
</ul>
</div>
<div id="tabs-log">
<h4><span id='proudly_brought_to_you_by'>Proudly brought to you by</span> <a target=_blank href="https://steemit.com/@justyy">@justyy</a> (<a target=_blank id='report_bugs' href="https://steakovercooked.com/Contact.Mail?title=LogoTurtle">Report Bugs</a>)
</h4>
<h5>
<a target=_blank href="https://github.com/DoctorLai/LogoTurtle"><B><span id='source_code'>Source Code</span></B>: https://github.com/DoctorLai/LogoTurtle</a>
</h5>
<textarea readonly class='form-control' rows=15 id='about'>
</textarea>
<BR/>
<a href="https://helloacm.com/out/buymecoffee" target="_blank"><img src="images/lato-blue.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
<a target=_blank href='https://justyy.com/out/bitcoin'><img src='images/bitcoin.jpg' class='banner'></a>
<a target=_blank href='https://justyy.com/out/vultr2'><img title='Free $10 VPS' src='images/vultr.jpg' class='banner'></a>
<a target=_blank href='https://justyy.com/out/linode'><img title='Free $20 VPS' src='images/linode.jpg' class='banner'></a>
</div>
</div>
<div id="status"> </div>
</body>
</html>