Homepage
Activities
Events
Blogs
Lists
Develop
Translate
Chat
Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Activities/Turtle Art
(view source)
Revision as of 20:29, 27 February 2011
912 bytes removed
,
20:29, 27 February 2011
→Looking under the hood
Line 137:
Line 137:
{{:Activities/TurtleArt/Logo}}
{{:Activities/TurtleArt/Logo}}
−
−
==Looking under the hood==
−
−
Turtle Art projects are stored as a .ta file contains a [http://docs.python.org/library/json.html json-encoded] serialization of the project.
−
−
The json encoding of a repeat 4 forward 100 right 90 project:
−
−
[[0,"repeat",331,158,[null,1,2,null]],[1,["number","4"],417,167,[0,null]],[2,"forward",426,207,[0,3,4]],[3,["number","100"],500,216,[2,null]],[4,"right",426,246,[2,5,null]],[5,["number","90"],500,255,[4,null]],[-1,"turtle",0,0,0,0,50,5]]
−
−
The basic structure of the encoding is a list of lists, where each block has these elements:
−
# block number
−
# block name or [block name, block value]
−
# x position (depreciated)
−
# y position (depreciated)
−
# list of connections to other blocks
−
−
Turtles are encoded at the end of the list:
−
# -1
−
# turtle or [turtle, turtle name]
−
# x position
−
# y position
−
# heading
−
# pen color
−
# pen shade
−
# pen width
{{:Activities/TurtleArt/ProgrammableBrick}}
{{:Activities/TurtleArt/ProgrammableBrick}}
Walter
Bureaucrats
,
Administrators
10,533
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Sugar
Downloads
Get started
FAQs
News
Get involved
Activity pages
Submit bugs
Get the source
About Sugar Labs
Donate to Sugar Labs
Contact info
Teams
Activity Team
Design Team
Documentation Team
Development Team
Infrastructure Team
Marketing Team
Platform Team
Translation Team
Wiki Team
Quick Links
Oversight Board
Governance
Human Interface Guidelines
people.sugarlabs.org
Recent changes
Categories
Service index
Wiki help
Code of Conduct
Local Labs
About local labs
Projects
Sugar Network
Sugar Creation Kit
Sugar on a Stick
Sugarizer
TOAST
Using the Wiki
Special pages
Printable version
Google translations
Afrikaans
አማርኛ
العربية
azərbaycanca
Bahasa Indonesia
Bahasa Melayu
Sunda
беларуская
বাংলা
български
bosanski
català
Cebuano
čeština
Chi-Chewa
corsu
Cymraeg
dansk
Deutsch
eesti
Ελληνικά
English
español
Esperanto
euskara
فارسی
français
Frysk
Gaeilge
Gàidhlig
galego
ગુજરાતી
Hausa
Hawaiʻi
한국어
עברית
हिन्दी
հայերեն
hmn
hrvatski
Igbo
isiXhosa
isiZulu
íslenska
italiano
jw
ქართული
ಕನ್ನಡ
қазақша
ភាសាខ្មែរ
Kiswahili
Kreyòl ayisyen
Кыргызча
kurdî
ລາວ
Latina
latviešu
Lëtzebuergesch
lietuvių
magyar
македонски
മലയാളം
Malti
Māori
монгол
मराठी
မြန်မာဘာသာ
Nederlands
नेपाली
日本語
norsk
ਪੰਜਾਬੀ
پښتو
polski
português
română
русский
Gagana Samoa
Sesotho
سنڌي
chiShona
shqip
සිංහල
slovenčina
slovenščina
Soomaaliga
српски / srpski
suomi
svenska
tj
Tagalog
ไทย
тоҷикӣ
தமிழ்
తెలుగు
Tiếng Việt
Türkçe
українська
oʻzbekcha/ўзбекча
اردو
ייִדיש
Yorùbá
中文(台灣)
中文(中国大陆)