LogoTurtle v0.0.2: ShowTurtle, HideTurtle, Color, Width and Help.
Introduction to Logo Turtle
This is the first Logo Interpreter in Google Chrome Webstore.
https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp
It is a very useful tool to teach kids turtle graphics.
Previous Contributions
- Teach Your Kids Programming - The First Logo Interpreter (Turtle Graphics) in Chrome Extension!
v0.0.1
v0.0.2 New Features
This Commit adds the following features:
- Show and Hide Turtle, so we know where the turtle is and its angle.
- Set Line Color and Width
- Tab
Help
to show a list of supported commands.
Screenshots
Turtle is at (0, 0) and heading North by default
cs
color blue width 2
repeat 4 [fd 100 rt 90]
color red width 1
lt 45 repeat 5 [fd 100 rt 144]
The line colors and widths can be set before each FD or BK.
Supported Commands in v0.0.2
How to Set Turtle Direction in JQuery?
// set turtle angle
setTurtleAngle(ang) {
this.turtle.css({
"-webkit-transform": "rotate(" + ang + "deg)",
"-moz-transform": "rotate(" + ang + "deg)",
"transform": "rotate(" + ang + "deg)" /* For modern browsers(CSS3) */
});
}
How to Get Next Local Scope?
To parse the LOGO program for square brackets.
// get next [] body
const getNextBody = (s, i, U) => {
let nested = 0;
// need to match [ and ]
let start = i;
while (i < U) {
if (s[i] == '[') {
nested ++;
if (nested == 1) {
start = i;
}
}
if (s[i] == ']') {
nested --;
if (nested == 0) {
break;
}
}
i ++;
}
return {left: start, right: i};
}
Roadmap of Chrome Extension: Logo Turtle
- Add Functions
- Add IF/THEN/ELSE
- Add Variables
- Add Colors
- Add MoveTo
- Add PrintText
- Add Circle
- Add Arc
- Add Eraser
- Add Fill
- Save As Picture
- Save As Program
- Comments
- etc. etc.
Technology Stack
If an App can be written in Javascript, eventually it will be written in Javascript.
Chrome Webstore
Install the Turtle Programming for Kids Now!
Contribution Welcome
Github: https://github.com/DoctorLai/LogoTurtle
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
Posted on Utopian.io - Rewarding Open Source Contributors
Nice post
thanks!
我觉得大人也可以跟着学习了😃
LOGO很有意思,很锻炼逻辑思考能力,最重要的是可以和孩子一起学习。
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @justyy I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x