create account

Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png by justyy

View this thread on: hive.blogpeakd.comecency.com
· @justyy · (edited)
$69.21
Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png
## Introduction to Logo Turtle
This is the [first Logo Interpreter](https://helloacm.com/logoturtle-v0-0-2-showturtle-hideturtle-color-width-and-help/) in Google Chrome Webstore.
https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp

It is a very useful tool to teach kids [turtle graphics](https://helloacm.com/teach-your-kids-programming-the-first-logo-interpreter-turtle-graphics-in-chrome-extension/).

## Previous Contributions
- v0.0.2: [LogoTurtle v0.0.2: ShowTurtle, HideTurtle, Color, Width and Help](https://helloacm.com/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](https://helloacm.com/teach-your-kids-programming-the-first-logo-interpreter-turtle-graphics-in-chrome-extension/)

## v0.0.3 New Features
[**This Commit**](https://github.com/DoctorLai/LogoTurtle/commit/c2f7d04cdc20e81cbd5a2c6ed1dfc4f5820af885) adds the following [features](https://helloacm.com/turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png/):
1. text
2. dot
3. jump
4. fontsize
5. download as png

## Screenshots
Supported Commands in v0.0.3

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512157/igqfokynqgwk2fxcdeok.png)

Syntax: text [text]
Syntax: fontsize size
For example,
```
fontsize 15 cs color blue repeat 8 [pu fd 100 lt 90 pd text [@justyy] rt 90 pu bk 100 rt 45]
```
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512182/bd3uli3fc20hpe9rpg63.png)

The turtle can **JUMP** using command *jump* or *jmp*
For example:

```
cs pu bk 100 pd repeat 5 [jump 10 fd 30]
```
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512310/ukyzav7xapnnsgt1pfsv.png)

You can click ↓ button to download the canvas as PNG.

Syntax: dot command asks the turtle to plot a dot where it is.
```
cs width 3 repeat 5 [ repeat 10 [jump 10 dot ] rt 144]
```
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512466/zbzwjxmne59vhitkf0qq.png)

## How to Ask Turtle to Jump?
```
case "jump":
case "jmp":
	if ((word_next == '') || (!isNumeric(word_next))) {
		this.pushErr(LOGO_ERR_MISSING_NUMBERS, word_next);
		return;
	}
	let pd = this.logo.isPendown();
	this.logo.pu();
	this.logo.fd(parseFloat(word_next));
	if (pd) {
		this.logo.pd();
	}
	i = y.next;
	break;	
```

## How to Download Canvas as Image?

```
    document.getElementById('download').addEventListener('click', () => {
        chrome.tabs.create({ url: canvas.toDataURL() });
    }, false);
```

## Roadmap of Chrome Extension: Logo Turtle
1. Add Functions
2. Add IF/THEN/ELSE
3. Add Variables
4. Add Colors
5. Add MoveTo
6. Add PrintText
7. Add Circle
8. Add Arc
9. Add Eraser
10. Add Fill
11. Save As Picture
12. Save As Program
13. Comments
14. etc. etc.

## Technology Stack
If an App can be written in [Javascript](https://helloacm.com/steemit-javascript-function-to-get-original-post-from-comments-permlink/), eventually it will be written in Javascript.

# Chrome Webstore
Install the [Turtle Programming for Kids](https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp) Now!

# Contribution Welcome
Github: https://github.com/DoctorLai/LogoTurtle
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request.

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@justyy/turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 23 others
properties (23)
authorjustyy
permlinkturtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png
categoryutopian-io
json_metadata{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":121791502,"name":"LogoTurtle","full_name":"DoctorLai/LogoTurtle","html_url":"https://github.com/DoctorLai/LogoTurtle","fork":false,"owner":{"login":"DoctorLai"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","steemstem","programming","cn","steemtools"],"links":["https://helloacm.com/logoturtle-v0-0-2-showturtle-hideturtle-color-width-and-help/","https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp","https://helloacm.com/teach-your-kids-programming-the-first-logo-interpreter-turtle-graphics-in-chrome-extension/","https://github.com/DoctorLai/LogoTurtle/commit/c2f7d04cdc20e81cbd5a2c6ed1dfc4f5820af885","https://helloacm.com/turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png/","https://helloacm.com/steemit-javascript-function-to-get-original-post-from-comments-permlink/","https://github.com/DoctorLai/LogoTurtle","https://utopian.io/utopian-io/@justyy/turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512157/igqfokynqgwk2fxcdeok.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512182/bd3uli3fc20hpe9rpg63.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512310/ukyzav7xapnnsgt1pfsv.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1519512466/zbzwjxmne59vhitkf0qq.png"],"moderator":{"account":"ms10398","time":"2018-02-26T14:06:58.729Z","reviewed":true,"pending":false,"flagged":false},"questions":[],"score":0}
created2018-02-24 22:50:51
last_update2018-02-26 14:07:06
depth0
children4
last_payout2018-03-03 22:50:51
cashout_time1969-12-31 23:59:59
total_payout_value48.690 HBD
curator_payout_value20.524 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,721
author_reputation280,616,224,641,976
root_title"Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,197,099
net_rshares15,852,093,367,985
author_curate_reward""
vote details (87)
@ms10398 ·
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/uTyJkNm).

**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorms10398
permlinkre-justyy-turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png-20180226t140714234z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-02-26 14:07:18
last_update2018-02-26 14:07:18
depth1
children0
last_payout2018-03-05 14:07:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length173
author_reputation27,572,487,973,390
root_title"Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,609,960
net_rshares0
@paulo380 ·
Would be nice learning some coding and designing. I have a plan to go into this field soon.
properties (22)
authorpaulo380
permlinkre-justyy-turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png-20180224t232123722z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-02-24 23:21:27
last_update2018-02-24 23:21:27
depth1
children1
last_payout2018-03-03 23:21:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length91
author_reputation6,388,272,905,577
root_title"Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,201,626
net_rshares0
@justyy ·
Sure this is fun!
properties (22)
authorjustyy
permlinkre-paulo380-re-justyy-turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png-20180224t233327864z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-02-24 23:33:27
last_update2018-02-24 23:33:27
depth2
children0
last_payout2018-03-03 23:33:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation280,616,224,641,976
root_title"Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,203,338
net_rshares0
@utopian-io ·
### Hey @justyy I am @utopian-io. I have just upvoted you!
#### Achievements
- WOW WOW WOW People loved what you did here. GREAT JOB!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**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**
properties (22)
authorutopian-io
permlinkre-justyy-turtle-graphics-programming-update-adding-text-jump-dot-fontsize-download-as-png-20180226t143000637z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-02-26 14:30:00
last_update2018-02-26 14:30:00
depth1
children0
last_payout2018-03-05 14:30:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,061
author_reputation152,955,367,999,756
root_title"Turtle Graphics Programming Update: Adding text, jump, dot, fontsize, download as png"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,614,985
net_rshares0