Turtle Programming v0.0.9: Add SetX, SetY, Square and Rect!
Introduction to Logo Turtle
LogoTurtle is currently the FIRST and only one Chrome Extension for Turtle Graphics. I have also written a PHP version of Logo Interpreter in 2006 but that runs only on the server.
Previous Contributions
- v0.0.8: Turtle Programming v0.0.8: /* */ comments, dotxy, and javascript!
- v0.0.7: Turtle Programming v0.0.7: Functions with Parameters + Recursion!
- v0.0.6: Turtle Programming v0.0.6: Adding Circle, MoveTo, Turn and Screen!
- v0.0.5: Turtle Programming v0.0.5: Adding IF/ELSE and STOP!
- v0.0.4: LogoTurtle: Make Variables and Comments
- v0.0.3: Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png
- v0.0.2: LogoTurtle v0.0.2: ShowTurtle, HideTurtle, Color, Width and Help.
- Teach Your Kids Programming - The First Logo Interpreter (Turtle Graphics) in Chrome Extension!
v0.0.1
v0.0.9 New Features
Along with bug fixes and code tweaks, This Commit has added the support of the following features/functions:
- Add
SetX
,SetY
that allows turtle to move in only 1 directions. (one parameter) - Set
Square
to draw a filled square. (one parameter) - Add
Rect
to draw a filled rectangle. (two parameters)
Screenshots
Drawing a curve
ht cs make "x 1 make "y 1
repeat 100 [
setx :x
sety :y
make "x :x+1 make "y :y*1.05
]
SetX and SetY in Javascript
case "setx":
word_next = this.evalVars(word_next);
if ((word_next == '') || (!isNumeric(word_next))) {
this.pushErr(word, LOGO_ERR_MISSING_NUMBERS, word_next);
return false;
}
this.logo.moveToX(parseFloat(word_next));
i = y.next;
break;
case "sety":
word_next = this.evalVars(word_next);
if ((word_next == '') || (!isNumeric(word_next))) {
this.pushErr(word, LOGO_ERR_MISSING_NUMBERS, word_next);
return false;
}
this.logo.moveToY(-parseFloat(word_next));
i = y.next;
break;
The Y coordinate mapping to canvas need to be inverted as the positive Y in Logo Coordinate system have a smaller Y value in Canvas.
Roadmap of Chrome Extension: Logo Turtle
Add FunctionsAdd IF/THEN/ELSEAdd VariablesAdd ColorsAdd MoveToAdd PrintTextAdd Circle- Add Arc
- Add Eraser
- Add Fill
Save As Picture- Save As Program
CommentsAdd Recursion Support- Add Global/Local Scopes
- Sleep
- 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
Being A SteemStem Member
I love playing with turtle, I implemented my own in clojure awhile ago. Its a really great way to exercise your programming skills.
Great extension btw.
@justyy, thank you for supporting @steemitboard as a witness.
Here is a small present to show our gratitude
You can click on your award to jump to your Board of Honor
Once again, thanks for your support!
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
cool project